Boost logo

Boost-Commit :

From: daniel_james_at_[hidden]
Date: 2008-04-20 08:42:38


Author: danieljames
Date: 2008-04-20 08:42:38 EDT (Sun, 20 Apr 2008)
New Revision: 44618
URL: http://svn.boost.org/trac/boost/changeset/44618

Log:
Some extra compile tests.

Text files modified:
   branches/unordered/trunk/libs/unordered/test/unordered/compile_tests.hpp | 12 +++++++++++-
   1 files changed, 11 insertions(+), 1 deletions(-)

Modified: branches/unordered/trunk/libs/unordered/test/unordered/compile_tests.hpp
==============================================================================
--- branches/unordered/trunk/libs/unordered/test/unordered/compile_tests.hpp (original)
+++ branches/unordered/trunk/libs/unordered/test/unordered/compile_tests.hpp 2008-04-20 08:42:38 EDT (Sun, 20 Apr 2008)
@@ -25,6 +25,7 @@
 typedef long double comparison_type;
 
 template <class T> void sink(T const&) {}
+template <class T> T rvalue(T const& v) { return v; }
 
 template <class X, class T>
 void container_test(X& r, T&)
@@ -144,11 +145,20 @@
 }
 
 template <class X, class Key, class T>
-void unordered_map_test(X&, Key const&, T const&)
+void unordered_map_test(X& r, Key const& k, T const& v)
 {
     typedef BOOST_DEDUCED_TYPENAME X::value_type value_type;
     typedef BOOST_DEDUCED_TYPENAME X::key_type key_type;
     BOOST_MPL_ASSERT((boost::is_same<value_type, std::pair<key_type const, T> >));
+
+#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
+ Key k_lvalue(k);
+ T v_lvalue(v);
+
+ r.emplace(k, v);
+ r.emplace(k_lvalue, v_lvalue);
+ r.emplace(rvalue(k), rvalue(v));
+#endif
 }
 
 template <class X, class T>


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