【发布时间】:2017-03-19 13:11:52
【问题描述】:
例如
struct A
{
A(B const& b) {} // function 1
};
struct B
{
operator A() const { return A(); } // function 2
};
还有
B b;
A a(b); // function 1 is called.
有什么方法可以让a被函数2构造或转换?
【问题讨论】:
-
我不这么认为;重载决议选择1
标签: c++ c++11 constructor type-conversion