[C++-sig] newbie questions
Stefan Seefeld
seefeld at sympatico.ca
Tue Oct 8 16:35:41 CEST 2002
David Abrahams wrote:
> 1. Are you trying to wrap an interface without changing it? In other
> words, is it OK to change the definition of Foo, Bar, and BarImpl,
> or is this wrapping job to be non-intrusive?
ideally it's non-intrusive. I'm all for cleaning it up (and it needs
some cleanup !), but that's not my (current) mandate...
> 2. What is the semantics of GetBar()? Does it just return a pointer to
> some BarImpl, to be used as a kind of reference, or is it the
> caller expected to delete (or otherwise manage) the pointer it gets
> back?
in this particular case Foo remains the owner.
> 3. If the BarImpl* is just a kind of reference, which object actually
> manages the lifetime of the BarImpl object?
Foo.
I guess in all other cases I would use the factory approach we
discussed yesterday.
Regards,
Stefan
More information about the Cplusplus-sig
mailing list