Boost logo

Boost :

From: Gary Powell (Gary.Powell_at_[hidden])
Date: 2000-04-07 10:39:11


Hi,
  This is more of a "Hey did anyone look at this?" Did we waste our time
making this library? (http://www.zib.de/weiser/vtl) (A prod for input.) We
were thinking of submitting this library to boost do you want it?

  Also is there a consensus on use of std::swap? In the views code we added
specializations of std::swap(viewType&,viewType&), and then added a
view::swap(view&) function which does a

namespace std {
   swap(viewType &a,viewType &b)
   {
       a.swap(b);
   }
}

class viewType {
public:
  ....
  void swap(view &a)
  {
     std::swap(base,a.base);
  }
};

I've been following a discussion in C.L.C++.M on swap and I'm confused. Is
it illegal to make more std::swap() specializations? Should my swap
functions be in my own namespace? Should my swap function do this?

void swap(view &a)
{
   using std::swap;
   swap(base,a.base);
}

Will the Koening lookup rules find the correct swap inside my function? Will
the stand library algorithms use my swap inside their functions?

 Any help on this will cause us to fix and adjust.

   -gary-

gary.powell_at_[hidden]


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