In order to make my codes more compliant with C++ style instead of C style, I want to replace errno with std::errno, and replace include <errno.h> with include <cerrno>.
To my supprise, these's NO std::errno !
As we known, many C things have an C++ equivalent. For expamle:
In a c-source.c, we code often like this:
#include <string.h>
print( strerro(1) );
In a c++source.cpp, we can do it like this:
#include <cstring>
std::cout << std::strerro(1);
Why is NOT there std::errno while std::strerro exists?
That is because,
errnois a preprocessor macro. It doesn't live in a namespace(actually it has no concept of namespaces etc). From errno documentation:(emphasis mine)
This means that we can't prepend
errnowithstd::.