15 Dec
2006
15 Dec
'06
9:54 p.m.
Brian Hassink wrote:
My question is why conversion of the shared_ptr reference does not work if it is not declared const?
A non-const reference doesn't bind to temporaries, it needs to bind directly to the argument (this a bit oversimplified but correct for our case). So the shared_ptr<B> argument is not converted to a temporary shared_ptr<A> in the non-const case.