On 13 November 2014 10:45, Richard Biener wrote: > > Hmm. > > struct assign; > struct base { > operator assign *() const { return (assign *)this; } > }; > struct assign : base { > }; > > void foo (assign *); > void bar (base *b) > { > foo (b); > } > > doesn't work, but > > void bar (base &b) > { > foo (b); > } > > does. Indeed C++ doesn't seem to provide what is necessary > for the compat trick :(
Right, base* is a built-in type, you can't call a member function on it. There is no implicit conversion between unrelated pointer types, and no implicit conversion from base* to base& that would be necessary to call the conversion operator of base.