Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2005-02-11 19:26:11


Daniel James wrote:
> [...]
> 'For unordered associative containers, no swap function throws an
> exception unless that exception is thrown by the copy constructor or
> copy assignment operator of the container's Hash or [equality] Pred
> object (if any).'
> [...]

Frankly, I don't understand why Hash or Pred should be copied
at all during a swap. If swapping Hash or Pred via std::swap()
would throw, it seems like a no-brainer that the authors of
Hash and Pred should provide a non-throwing swap() which can be
discovered via ADL. In fact, I don't see any good reason why the
standard shouldn't simply require that Hash and Pred provide a
non-throwing swap() if std::swap() would throw.

Dave


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