From 659a014976e941ddf01a199c5e477c8a97b7ec40 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 15 Jun 2008 17:03:37 +0000 Subject: [PATCH] Fix in an error in the unordered containers' emulated move constructors. These aren't actually used, so I could probalby just remove 'move_from' for now (it's used in the full move library). [SVN r46410] --- include/boost/unordered_map.hpp | 4 ++-- include/boost/unordered_set.hpp | 4 ++-- test/unordered/compile_map.cpp | 15 +++++++++++++++ test/unordered/compile_set.cpp | 13 +++++++++++++ 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/include/boost/unordered_map.hpp b/include/boost/unordered_map.hpp index c172881f..bd6cfb2f 100644 --- a/include/boost/unordered_map.hpp +++ b/include/boost/unordered_map.hpp @@ -122,7 +122,7 @@ namespace boost } #else unordered_map(boost::unordered_detail::move_from > other) - : base(other.base, boost::unordered_detail::move_tag()) + : base(other.source.base, boost::unordered_detail::move_tag()) { } @@ -507,7 +507,7 @@ namespace boost } #else unordered_multimap(boost::unordered_detail::move_from > other) - : base(other.base, boost::unordered_detail::move_tag()) + : base(other.source.base, boost::unordered_detail::move_tag()) { } diff --git a/include/boost/unordered_set.hpp b/include/boost/unordered_set.hpp index 5acdf55b..61922f85 100644 --- a/include/boost/unordered_set.hpp +++ b/include/boost/unordered_set.hpp @@ -119,7 +119,7 @@ namespace boost } #else unordered_set(boost::unordered_detail::move_from > other) - : base(other.base, boost::unordered_detail::move_tag()) + : base(other.source.base, boost::unordered_detail::move_tag()) { } @@ -476,7 +476,7 @@ namespace boost } #else unordered_multiset(boost::unordered_detail::move_from > other) - : base(other.base, boost::unordered_detail::move_tag()) + : base(other.source.base, boost::unordered_detail::move_tag()) { } diff --git a/test/unordered/compile_map.cpp b/test/unordered/compile_map.cpp index 9e12d4c4..0e870fc6 100644 --- a/test/unordered/compile_map.cpp +++ b/test/unordered/compile_map.cpp @@ -13,6 +13,21 @@ #include "../objects/minimal.hpp" #include "./compile_tests.hpp" +// Explicit instantiation to catch compile-time errors + +template class boost::unordered_map< + test::minimal::assignable, + test::minimal::default_copy_constructible, + test::minimal::hash, + test::minimal::equal_to, + test::minimal::allocator >; +template class boost::unordered_multimap< + test::minimal::assignable, + test::minimal::copy_constructible, + test::minimal::hash, + test::minimal::equal_to, + test::minimal::allocator >; + UNORDERED_AUTO_TEST(test0) { typedef std::pair, + test::minimal::equal_to, + test::minimal::allocator >; +template class boost::unordered_multiset< + test::minimal::assignable, + test::minimal::hash, + test::minimal::equal_to, + test::minimal::allocator >; + UNORDERED_AUTO_TEST(test0) { test::minimal::assignable assignable = test::minimal::assignable::create();