|
Boost : |
From: David B. Held (dheld_at_[hidden])
Date: 2002-04-19 00:30:27
"Andrei Alexandrescu" <andrewalex_at_[hidden]> wrote in message
news:a9o8g4$em0$1_at_main.gmane.org...
> [...]
> There are two ways to redesign:
>
> (1) we add a template parameter "Base" to two policies and we build a
> linear hierarchy;
>
> (2) we assume that StoragePolicy always stores state so we store it as
> a member inside SmartPtr. Then, we assume the CheckingPolicy doesn't
> ever store any state and defines only static functions, so we don't
> store it anywhere nor derive from it. Finally, we assume that
> OwnershipPolicy may or may not store state so we derive (solely) from
> it.
I like the sound of version 2. ;) I might even be able to hack it.
While I understand how version 1 works in principle, I'm not sure
I could write a good implementation. Do you plan to rewrite
SmartPtr for Loki as well? If so, I'll stop messing with my version,
and wait for the new version.
Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk