Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79503 - trunk/libs/unordered/test/unordered
From: dnljms_at_[hidden]
Date: 2012-07-14 12:45:54


Author: danieljames
Date: 2012-07-14 12:45:54 EDT (Sat, 14 Jul 2012)
New Revision: 79503
URL: http://svn.boost.org/trac/boost/changeset/79503

Log:
Unordered: Fix unnecessary_copy_tests for MSVC10

Compilers with rvalue references can avoid creating a node, as they can use the
value from the rvalue reference to check if the value is already in the
container (in this case it is) before creating the node. Could possibly do the
same for compilers without rvalue references, if it can get a value out of
Boost.Move's rvalue reference emulation.
Text files modified:
   trunk/libs/unordered/test/unordered/unnecessary_copy_tests.cpp | 3 ++-
   1 files changed, 2 insertions(+), 1 deletions(-)

Modified: trunk/libs/unordered/test/unordered/unnecessary_copy_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/unnecessary_copy_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/unnecessary_copy_tests.cpp 2012-07-14 12:45:54 EDT (Sat, 14 Jul 2012)
@@ -245,7 +245,8 @@
         // the existing element.
         reset();
         x.emplace();
-#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES) || \
+ !defined(BOOST_NO_RVALUE_REFERENCES)
         // source_cost doesn't make much sense here, but it seems to fit.
         COPY_COUNT(1); MOVE_COUNT(source_cost);
 #else


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk