Problem with an overloaded cast operator

Alexandre Oliva aoliva@cygnus.com
Mon Apr 3 02:58:00 GMT 2000


On Apr  3, 2000, Ryszard Kabatek <rumcajs@gmx.net> wrote:

> I wolud expect, the sample below should not compile (g++ -Wall), 
> because the function f() returns X by value and the copying of X 
> is forbidden.

But `f' is a friend of `X', so it can access the private
copy-constructor.

-- 
Alexandre Oliva    Enjoy Guaraná, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me



More information about the Gcc mailing list