Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
  {
    return Traits::invalid() != value;
  }

Compiler error: error C2071: foo::operator bool' : illegal storage class

like image 903
MW_dev Avatar asked Aug 06 '11 14:08

MW_dev


1 Answers

No, VS2010 has a very limited C++0x support. Here is a list of features that are supported by VS2010.

like image 192
Yakov Galka Avatar answered Nov 12 '22 10:11

Yakov Galka