Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2003-08-08 17:20:34


David B. Held wrote:
> Hmm...ok, I'm not getting anywhere talking about it abstractly, so
> I'll just say that I'm trying to figure out how to improve the policy
> adaptor interface for smart_ptr. In particular, I would like to go
> from this:
>
> smart_ptr<int, my_policy<_>, my_other_policy<_> > p;
>
> to this:
>
> smart_ptr<int, my_policy, my_other_policy> p;
>
> I know I can do this by changing my_*policy to a metafunction
> class. But then smart_ptr doesn't know where the guts are.

I am afraid I don't exactly understand the last sentence ;), but if
'smart_ptr' does something like

    typedef typename apply<
          typename lambda<Policy>::type
        , T
>::type p;

things should work independently of whenever 'Policy' is in form of
'my_policy<_>' or 'my_policy' - given that the latter is a metafunction
class, of course.

HTH,
Aleksey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk