Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2002-06-27 22:38:34


Greg Colvin wrote:
> >> So you can write generic code like
> >>
> >> template<template<typename T> class Ptr> struct x { Ptr<X> p; };
> >>
> >> and have a Ptr with raw pointer semantics.
> >
> >And the advantage of this over
> >
> > template<class Ptr> struct x { Ptr p; };
> >
> >is?
>
> template<template<typename T> class Ptr> struct x {
> Ptr<X> px;
> Ptr<Y> py;
> ...
> };

Not for the sake of the argument at all :) - the above assumes that
'template< typename T > class ptr' is _the_ de-facto standard for smart
pointers' "signature", but it isn't (well, may be it is for Boost, at least
right now, but policy-based pointers might change that as well).

/Aleksey


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