
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? http://tinyurl.com/6h298c
Thanks for the link! I just did some promotion of the new boost::swap utility at the blogs.msdn.com/vcblog 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 [boost]: http://svn.boost.org/trac/boost/ticket/1910 Kind regards, -- Niels Dekker http://www.xs4all.nl/~nd/dekkerware Scientific programmer at LKEB, Leiden University Medical Center