Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2003-01-28 09:39:39


On Monday 27 January 2003 08:26 pm, David B. Held wrote:
> My understanding is that the template constructor:
>
> template
> <
> typename T1,
> template <class> class OP1,
> class CP1,
> template <class> class KP1,
> template <class> class SP1
>
> SmartPtr(SmartPtr<T1, OP1, CP1, KP1, SP1> const& rhs)
>
> is going to somehow get in the way by "eating" everything,
> and in particular not allow the constructor:
>
> SmartPtr(ByRef<SmartPtr> rhs)
>
> to kick in, as it should.

*sniff* *sniff* Smells like enable_if:

template
<
  typename T1,
  template <class> class OP1,
  class CP1,
  template <class> class KP1,
  template <class> class SP1
>
SmartPtr(SmartPtr<T1, OP1, CP1, KP1, SP1> const& rhs,
              typename SmartPtr<T1, OP1, CP1, KP1, SP1>::copyable* = 0)

In SmartPtrs are should be copyable, include
  typedef void copyable;

In other SmartPtrs, don't include typedef copyable.

        Doug


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