开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜