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.

Peter Dimov
Multi Media Ltd.

Boost list run by bdawes at, gregod at, cpdaniel at, john at