Does MSVC10 Visual Studio 2010 support C++ explicit conversion operators
Does Visual Studio 2010 MSVC10 support explicit conversion operators, or is the safe bool idiom still required to be implemented?
This code does not compile:
explicit operator bool() const
{
retu开发者_JAVA百科rn Traits::invalid() != value;
}
Compiler error: error C2071: foo::operator bool' : illegal storage class
No, VS2010 has a very limited C++0x support. Here is a list of features that are supported by VS2010.
精彩评论