[LC++]g++ thinks default-constructed object is actually a function

Dr Mark H Phillips mark at austrics.com.au
Wed Apr 7 14:58:01 UTC 2004


Hi Peter,

Thanks for your reply.

On Wed, 2004-04-07 at 16:11, Peter Poulsen wrote:
> My help may not be that helpfull as I'm running gcc 2.95, but I managed
> to get it running by changing the lines in the main function to the
> following.
> 
> Ownrisk r;
> Posint a(r, i);
> std::cout<<"a = "<<a<<std::endl;

Yes, I found that work-around too, but I still feel there must be a way
to do it without requiring the user to explicitly create a named Ownrisk
object.  It should be possible to create a default-constructed temporary
in that position.  I don't know how though!

Cheers,

Mark.




More information about the tuxCPProgramming mailing list