I have two classes:
struct B {};
struct D {
operator B& ();
};
When will I do it;
b = d; // B b; ... D d;
The result corresponds to the expectation in which D::operator B&()( Demo ) is called.
If the parameter is Dchanged to,
struct D : B {
operator B& ();
};
it is D::operator B&()not called ( Demo ). B::B(const B&)finds a better candidate in D, then D::operator B&()?
source
share