|
Boost : |
From: Edd Dawson (lists_at_[hidden])
Date: 2007-09-21 16:14:26
Hi Igor!
Igor.Smirnov_at_[hidden] wrote:
> May be I am behind progress, but I do not know a way to make cloning
> pointer (or that Mathias' value object, but this seems to be the same in
> principle) to be non-intrusive. You anyway need virtual cloning function
> in each class of the hierarchy.
That's absolutely true, but if the user put their object in to a poly_obj at the
earliest possible opportunity, this wouldn't be necessary. The static type is
available at the point of construction and if you can keep hold of that (and you
can), you won't run in to any problems.
I can't imagine (at the moment) why someone would want to delay until they only
have access to their object through a pointer or reference to base-type. It's
good practice to put objects that require "management" of some kind in to some
kind of other handler object as soon as they're constructed, anyway.
Edd
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk