草庐IT

UserModifiedPolicy

全部标签

c++ - VC++ 2013 : using-declaration + redefinition of member function leads to compile error

我想通过指定策略允许修改我的类的行为。该策略应该用作boost::variant的访问者。有适合大多数情况的默认策略,但用户可能需要添加或替换一些重载。我发现vc++2013没有编译此代码并出现错误C3066:Therearemultiplewaysthatanobjectofthistypeofcanbecalledwiththesearguments。相同的代码在gcc和clang中按预期编译和工作。是vc++2013的错误吗?#includestructDefaultPolicy{voidoperator()(bool){std::coutUPD这个例子适用于vc++2010。看