Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2007-11-23 14:04:22


Joaquín Mª López Muñoz wrote:
> Ok, so we've got a case again. John, let me re-ask you about what we
> should do regarding this compiler bug. For your reference, the
> offending code
> does not involve name hiding anymore:

Yes it does: foo::swap is still in the current scope :-(

Making swap_ a non-member function would fix it (I hope!):

template <class T>
void call_swap(T& a, T& b)
{ using std::swap; swap(a, b); }

template<typename T>
struct foo
{
  T t;
  foo():t(0){}
  void swap(foo& x){call_swap(t, x.t);}
};

Does this help?

John.


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