开发者

Does MSVC10 Visual Studio 2010 support C++ explicit conversion operators

开发者 https://www.devze.com 2023-03-26 03:42 出处:网络
Does Visual Studio 2010 MSVC10 support explicit conversion operators, or is the safe bool idiom still required to be implemented?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消