|
Boost : |
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2002-05-03 14:53:18
"David B. Held" <dheld_at_[hidden]> wrote in message
news:aauihq$sul$1_at_main.gmane.org...
> "Gennadiy Rozental" <rogeeff_at_[hidden]> wrote in message
> news:aathh3$nmj$1_at_main.gmane.org...
> > [...]
> > 1. OptionallyInherit need default constructor
We need for OptionallyInherit
a. default constructor
b. templated copy constructor that forward args to appropriate parent
c. see below
> > 2. What to do with smart_ptr( stored_type const& )?
FWIW there is no clean way to handle this. Our only choice is to rely on the
fact that StoragePolicy last (first in my case) parameter. Then we can
provide 1 arg template parameter constructor that forward argument always to
second(first) parent.
> > 3. What to do with swap? Empty classes are not parents anymore
> > and can't convert argument. Was inforced to move swap into
> > OptionallyInherit. Now empty classes does not really need them.
I pushed swap to OptionallyInherit. and it is working.
> > 4. As well as any other constructors. But this means that we lost
> > conertability checks. For example smart_ptr with disallow_convertion
> > will perfectly convert to allow conversion. The same this any other
> > undersirable conversion.
I intend to use is_convertable checks in 2-arg template copy constructors to
inforce convertability.
>
> I see how c'tors are a problem all around. I tried suggesting some
> alternatives, but the problem is knowing which policies got inherited.
> I'm wondering if the OptionallyInherit strategy can be made to work.
>
> Dave
>
Gennadiy.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk