Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-08-17 12:32:09


From: "George A. Heintzelman" <georgeh_at_[hidden]>
> Why get rid of the std::swap specialization? Although it is unnecessary
> for good exception safety, it is going to be faster than the default
> version, since you avoid several increments and decrements of the
> reference counts (admittedly a compiler can optimize those away, but
> why force it to?). Since it is already written and works, you may as
> well leave it. There aren't any issues with specializing this in std::,
> are there? shared_ptr<x> is a UDT, so it should be legal...

A specialization would be legal. However std::swap is a function template
and the language does not support partial function template specializations.

http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#226
http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2001/n1296.htm

--
Peter Dimov
Multi Media Ltd.

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