This error is present when compiling against Visual C++ 2003 through 2013. It is not present when compiling against g++ 4.9.2.
#include <ios>
int main() {
left(*(new std::string));
return 0;
}
The problem is that it reports some some error about the arguments. The result I expect is for it to say "identifier not found" because std::left() should be out of scope!
Example of copied inline function:
STD_BEGIN
inline std::ios_base& __CLRCALL_OR_CDECL left2(std::ios_base& _Iosbase) {
_Iosbase.setf(std::ios_base::left, std::ios_base::adjustfield);
return (_Iosbase);
}
_STD_END
I examined ios and found that it's an inline function. I copied it out, stuck it into the std namespace using the same macros, and gave it a new name. But the new function is out of scope?
So why is std::left() and std::right() in scope here?