From ff66f79721909315222e54a661fdc08288418739 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Mon, 4 Jul 2011 21:52:17 +0000 Subject: [PATCH] Unordered: Import functions into boost namespace. [SVN r72905] --- include/boost/unordered/detail/fwd.hpp | 37 ------------------- include/boost/unordered/unordered_map_fwd.hpp | 26 +++++++++++++ include/boost/unordered/unordered_set_fwd.hpp | 26 +++++++++++++ test/unordered/compile_tests.hpp | 3 ++ 4 files changed, 55 insertions(+), 37 deletions(-) diff --git a/include/boost/unordered/detail/fwd.hpp b/include/boost/unordered/detail/fwd.hpp index c923ace3..8185e4f5 100644 --- a/include/boost/unordered/detail/fwd.hpp +++ b/include/boost/unordered/detail/fwd.hpp @@ -25,15 +25,6 @@ namespace unordered class P = std::equal_to, class A = std::allocator > > class unordered_map; - template - inline bool operator==(unordered_map const&, - unordered_map const&); - template - inline bool operator!=(unordered_map const&, - unordered_map const&); - template - inline void swap(unordered_map&, - unordered_map&); template , class A = std::allocator > > class unordered_multimap; - template - inline bool operator==(unordered_multimap const&, - unordered_multimap const&); - template - inline bool operator!=(unordered_multimap const&, - unordered_multimap const&); - template - inline void swap(unordered_multimap&, - unordered_multimap&); template , class P = std::equal_to, class A = std::allocator > class unordered_set; - template - inline bool operator==(unordered_set const&, - unordered_set const&); - template - inline bool operator!=(unordered_set const&, - unordered_set const&); - template - inline void swap(unordered_set &m1, - unordered_set &m2); template , class P = std::equal_to, class A = std::allocator > class unordered_multiset; - template - inline bool operator==(unordered_multiset const&, - unordered_multiset const&); - template - inline bool operator!=(unordered_multiset const&, - unordered_multiset const&); - template - inline void swap(unordered_multiset &m1, - unordered_multiset &m2); - } } diff --git a/include/boost/unordered/unordered_map_fwd.hpp b/include/boost/unordered/unordered_map_fwd.hpp index ad4693e9..b98537eb 100644 --- a/include/boost/unordered/unordered_map_fwd.hpp +++ b/include/boost/unordered/unordered_map_fwd.hpp @@ -14,8 +14,34 @@ namespace boost { + namespace unordered + { + template + inline bool operator==(unordered_map const&, + unordered_map const&); + template + inline bool operator!=(unordered_map const&, + unordered_map const&); + template + inline void swap(unordered_map&, + unordered_map&); + + template + inline bool operator==(unordered_multimap const&, + unordered_multimap const&); + template + inline bool operator!=(unordered_multimap const&, + unordered_multimap const&); + template + inline void swap(unordered_multimap&, + unordered_multimap&); + } + using ::boost::unordered::unordered_map; using ::boost::unordered::unordered_multimap; + using ::boost::unordered::swap; + using ::boost::unordered::operator==; + using ::boost::unordered::operator!=; } #endif diff --git a/include/boost/unordered/unordered_set_fwd.hpp b/include/boost/unordered/unordered_set_fwd.hpp index b1737cbb..1935bc5d 100644 --- a/include/boost/unordered/unordered_set_fwd.hpp +++ b/include/boost/unordered/unordered_set_fwd.hpp @@ -14,8 +14,34 @@ namespace boost { + namespace unordered + { + template + inline bool operator==(unordered_set const&, + unordered_set const&); + template + inline bool operator!=(unordered_set const&, + unordered_set const&); + template + inline void swap(unordered_set &m1, + unordered_set &m2); + + template + inline bool operator==(unordered_multiset const&, + unordered_multiset const&); + template + inline bool operator!=(unordered_multiset const&, + unordered_multiset const&); + template + inline void swap(unordered_multiset &m1, + unordered_multiset &m2); + } + using ::boost::unordered::unordered_set; using ::boost::unordered::unordered_multiset; + using ::boost::unordered::swap; + using ::boost::unordered::operator==; + using ::boost::unordered::operator!=; } #endif diff --git a/test/unordered/compile_tests.hpp b/test/unordered/compile_tests.hpp index d22a9fc0..8d06e7d1 100644 --- a/test/unordered/compile_tests.hpp +++ b/test/unordered/compile_tests.hpp @@ -129,6 +129,7 @@ void container_test(X& r, T const&) test::check_return_type::equals(a_const.cend()); a.swap(b); + boost::swap(a, b); test::check_return_type::equals_ref(r = a); test::check_return_type::equals(a.size()); test::check_return_type::equals(a.max_size()); @@ -180,6 +181,8 @@ void equality_test(X& r) test::check_return_type::equals(a == b); test::check_return_type::equals(a != b); + test::check_return_type::equals(boost::operator==(a, b)); + test::check_return_type::equals(boost::operator!=(a, b)); } template