Boost logo

Boost :

From: Niels Dekker - mail address until 2008-12-31 (nd_mail_address_valid_until_2008-12-31_at_[hidden])
Date: 2008-08-22 04:38:56

Michael Marcin wrote:
> Could we specialize std::_Move_operation_category for this version of
> VC9 to enable this optimization for boost types that can benefit from
> it?

Thanks for the link! I just did some promotion of the new boost::swap
utility at the site :-)

Shouldn't this MSVC optimization be enabled for /any/ type that has a
custom swap function? Typically such a type has a swap member function
as well. So can't this std::_Move_operation_category be specialized
based on some template meta programming (e.g.,
has_swap_member<T>::value)? Such an approach looks preferable to me
than adding a macro call (BOOST_MSVC_FAST_SWAP_OPTIMIZATION) for each
type that has a custom swap.

> I have code that uses a lot of boost::shared_ptr and there are some
> things that are just broken in vc9's tr1 implementation. You can't
> store tr1 functions in a std::container for instance because of a bug.
> I would really like to get the no copy no throw container manipulation
> for things like boost::function and boost::shared_ptr and all it takes
> is a simple trait specialization.

Please note that the current version of boost::function::swap is /less/
efficient than doing a single copy. A few months ago, I submitted a
ticket on this issue, triggered by a posting from Arvid Norberg here at

Kind regards,

Niels Dekker
Scientific programmer at LKEB, Leiden University Medical Center 

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