From: Ioannis V. <no...@ho...> - 2002-06-20 23:29:45
|
> -----Original Message----- > From: min...@li... > [mailto:min...@li...] On Behalf Of > Garrett Serack > Sent: Friday, June 21, 2002 12:52 AM > To: Min...@li... > Subject: Re: [Mingw-users] I'm trying to port some code from > VC++ to Mingw > > > > > > > > I'll try it out on the Intel compiler next, and see what > that's doing. > > > Yep, Intel's 6.0 compiler works fine too. Ok let me summarize. At first as another said the alpha a() is a function declaration depending on context. new alpha() is a call to the default constructor but is meaningless. Second i made a mistake talking about that the mistake is due to a possible optimisation of the style A a=x; to get A a(x); It happens some times, but the whole thing must *behave* as if a temporary is created and is copied, so there can be no ambiguity on this, it is a system's responsibility of how to get things done. The problem is due to ptr(&ptr) and is dangerous to point temporaries with simple references (must produce at least some diagnostic). The proper solution is to make it a const reference: ptr(const ptr &); It is not a GCC problem. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.cjb.net * Alternative URL: http://run.to/noicys |