1
下面的类似乎compile,但转换运营商从来不被称为:超载引用转换
class A
{
public:
operator A() const { std::cout << "A() called" << std::endl; return *this; }
operator A&() { std::cout << "A&() called" << std::endl; return *this; }
operator const A&() const { std::cout << "const A&() called" << std::endl; return *this; }
};
是指定转化为对自身的引用的函数根本不理?
我确定有人会引用这个标准,但同时我会说明一点:这根本没有任何意义。 – David 2012-03-09 04:41:47