[LC++]temporals objects

Mark Phillips mark at austrics.com.au
Mon Dec 17 12:32:25 UTC 2001


Roberto Diaz wrote:

> void push_back (OtherClass *);

You say you want to define push_back this way so that you can
do:

> OtherClass b;
> a.push_back(&b);

But why would you want this?  Why not just do:

OtherClass b;
a.push_back(b);

?

Are you wanting to store pointers to objects rather than objects?  If
so, what part of your program is in charge of creating and maintaining
the actual objects?

Cheers,

Mark.



More information about the tuxCPProgramming mailing list