|
Boost : |
From: David B. Held (dheld_at_[hidden])
Date: 2003-01-29 19:30:21
"David Abrahams" <dave_at_[hidden]> wrote in message
news:uel6vece8.fsf_at_boost-consulting.com...
> [...]
> Orthogonality itself never plays agin' ya. It's when you try to force
> orthogonality on things which actually have to cooperate closely that
> you get problems. I'm not sure we have that case here, but it looks
> like a possibility. One way out, as Dave H. has suggested, might be
> to impose nothrow requirements to get back some independence.
Hopefully, it won't come to that, if my latest implementation is non-
stupid. However, there's no guarantee of that (it fails to provide the
non-stupid guarantee), since the previous suggestion of calling
storage_policy::destroy() from ownership_policy was blatantly wrong.
I fell into the same trap you did thinking that it was a static function
that could be called from anywhere. Unfortunately (or fortunately,
depending on how you look at it), storage_policy is not a base class
of ownership_policy, so that call would have been illegal. Thus, the
policy interaction as I suggested it buys you nothing. However, I do
seem to recall that Beman's plan did involve some inheritance between
policies, and that design probably does offer the non-stupid guarantee.
I think the two-step ownership acquisition is the better way to go,
here.
Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk