diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index ceb7d91a..1ccb5214 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -8,10 +8,7 @@ path-constant admonishment_location : ../../../../doc/src/images ; xml unordered : unordered.qbk ; boostbook standalone : unordered : - html.stylesheet=../../../../doc/html/boostbook.css boost.root=../../../.. - boost.libraries=../../../libraries.htm - navig.graphics=1 chunk.first.sections=1 chunk.section.depth=2 diff --git a/include/boost/unordered/detail/fwd.hpp b/include/boost/unordered/detail/fwd.hpp index 1598cdb0..c1c31ffc 100644 --- a/include/boost/unordered/detail/fwd.hpp +++ b/include/boost/unordered/detail/fwd.hpp @@ -31,7 +31,7 @@ // G = Grouped/Ungrouped // E = Key Extractor -#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL) +#if !defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_NO_VARIADIC_TEMPLATES) # if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) // STLport doesn't have std::forward. # else diff --git a/include/boost/unordered/detail/util.hpp b/include/boost/unordered/detail/util.hpp index 22b41583..55409651 100644 --- a/include/boost/unordered/detail/util.hpp +++ b/include/boost/unordered/detail/util.hpp @@ -32,12 +32,6 @@ namespace boost { namespace unordered_detail { //////////////////////////////////////////////////////////////////////////// // primes - template struct prime_list_template - { - static std::size_t const value[]; - static std::ptrdiff_t const length; - }; - #define BOOST_UNORDERED_PRIMES \ (5ul)(11ul)(17ul)(29ul)(37ul)(53ul)(67ul)(79ul) \ (97ul)(131ul)(193ul)(257ul)(389ul)(521ul)(769ul) \ @@ -47,14 +41,28 @@ namespace boost { namespace unordered_detail { (50331653ul)(100663319ul)(201326611ul)(402653189ul)(805306457ul) \ (1610612741ul)(3221225473ul)(4294967291ul) + template struct prime_list_template + { + static std::size_t const value[]; + +#if !defined(SUNPRO_CC) + static std::ptrdiff_t const length; +#else + static std::ptrdiff_t const length + = BOOST_PP_SEQ_SIZE(BOOST_UNORDERED_PRIMES); +#endif + }; + template std::size_t const prime_list_template::value[] = { BOOST_PP_SEQ_ENUM(BOOST_UNORDERED_PRIMES) }; +#if !defined(SUNPRO_CC) template std::ptrdiff_t const prime_list_template::length = BOOST_PP_SEQ_SIZE(BOOST_UNORDERED_PRIMES); +#endif #undef BOOST_UNORDERED_PRIMES diff --git a/include/boost/unordered/unordered_map.hpp b/include/boost/unordered/unordered_map.hpp index 93e19789..4c399b8a 100644 --- a/include/boost/unordered/unordered_map.hpp +++ b/include/boost/unordered/unordered_map.hpp @@ -19,7 +19,7 @@ #include #include -#if !defined(BOOST_HAS_RVALUE_REFS) +#if defined(BOOST_NO_RVALUE_REFERENCES) #include #endif @@ -159,7 +159,7 @@ namespace boost ~unordered_map() {} -#if defined(BOOST_HAS_RVALUE_REFS) +#if !defined(BOOST_NO_RVALUE_REFERENCES) unordered_map(unordered_map&& other) : table_(other.table_, boost::unordered_detail::move_tag()) { @@ -699,7 +699,7 @@ namespace boost ~unordered_multimap() {} -#if defined(BOOST_HAS_RVALUE_REFS) +#if !defined(BOOST_NO_RVALUE_REFERENCES) unordered_multimap(unordered_multimap&& other) : table_(other.table_, boost::unordered_detail::move_tag()) { diff --git a/include/boost/unordered/unordered_set.hpp b/include/boost/unordered/unordered_set.hpp index 87c1011b..2c291f46 100644 --- a/include/boost/unordered/unordered_set.hpp +++ b/include/boost/unordered/unordered_set.hpp @@ -19,7 +19,7 @@ #include #include -#if !defined(BOOST_HAS_RVALUE_REFS) +#if defined(BOOST_NO_RVALUE_REFERENCES) #include #endif @@ -153,7 +153,7 @@ namespace boost ~unordered_set() {} -#if defined(BOOST_HAS_RVALUE_REFS) +#if !defined(BOOST_NO_RVALUE_REFERENCES) unordered_set(unordered_set&& other) : table_(other.table_, boost::unordered_detail::move_tag()) { @@ -645,7 +645,7 @@ namespace boost ~unordered_multiset() {} -#if defined(BOOST_HAS_RVALUE_REFS) +#if !defined(BOOST_NO_RVALUE_REFERENCES) unordered_multiset(unordered_multiset&& other) : table_(other.table_, boost::unordered_detail::move_tag()) { diff --git a/test/exception/insert_exception_tests.cpp b/test/exception/insert_exception_tests.cpp index 85776241..84278c0e 100644 --- a/test/exception/insert_exception_tests.cpp +++ b/test/exception/insert_exception_tests.cpp @@ -39,7 +39,7 @@ struct insert_test_base : public test::exception_base } }; -#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL) +#if !defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_NO_VARIADIC_TEMPLATES) template struct emplace_test1 : public insert_test_base @@ -238,7 +238,7 @@ struct insert_test_rehash3 : public insert_test_base (insert_test1)(insert_test2)(insert_test3)(insert_test4) \ (insert_test_rehash1)(insert_test_rehash2)(insert_test_rehash3) -#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL) +#if !defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_NO_VARIADIC_TEMPLATES) #define ALL_TESTS (emplace_test1)BASIC_TESTS #else #define ALL_TESTS BASIC_TESTS diff --git a/test/unordered/insert_tests.cpp b/test/unordered/insert_tests.cpp index f0136b70..5af8be66 100644 --- a/test/unordered/insert_tests.cpp +++ b/test/unordered/insert_tests.cpp @@ -231,7 +231,7 @@ void insert_tests2(X*, } } -#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL) +#if !defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_NO_VARIADIC_TEMPLATES) template void unique_emplace_tests1(X*, @@ -403,7 +403,7 @@ UNORDERED_TEST(insert_tests2, ((default_generator)(generate_collisions)) ) -#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL) +#if !defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_NO_VARIADIC_TEMPLATES) UNORDERED_TEST(unique_emplace_tests1, ((test_set)(test_map)) ((default_generator)(generate_collisions)) diff --git a/test/unordered/move_tests.cpp b/test/unordered/move_tests.cpp index 1e580848..f29983eb 100644 --- a/test/unordered/move_tests.cpp +++ b/test/unordered/move_tests.cpp @@ -134,7 +134,7 @@ namespace move_tests { test::random_values v(25, generator); T y(create(v, count, hf, eq, al, 1.0), al); -#if defined(BOOST_HAS_RVALUE_REFS) +#if !defined(BOOST_NO_RVALUE_REFERENCES) BOOST_TEST(count == test::global_object_count); #else BOOST_TEST( diff --git a/test/unordered/unnecessary_copy_tests.cpp b/test/unordered/unnecessary_copy_tests.cpp index b3a580df..58bc3b70 100644 --- a/test/unordered/unnecessary_copy_tests.cpp +++ b/test/unordered/unnecessary_copy_tests.cpp @@ -31,7 +31,7 @@ namespace unnecessary_copy_tests : tag_(x.tag_) { ++copies; } count_copies(count_copies const& x) : tag_(x.tag_) { ++copies; } -#if defined(BOOST_HAS_RVALUE_REFS) +#if !defined(BOOST_NO_RVALUE_REFERENCES) count_copies(count_copies&& x) : tag_(x.tag_) { x.tag_ = -1; ++moves; } @@ -136,7 +136,7 @@ namespace unnecessary_copy_tests reset(); T x; x.emplace(source()); -#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL) +#if !defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_NO_VARIADIC_TEMPLATES) COPY_COUNT(1); #else COPY_COUNT(2); @@ -148,7 +148,7 @@ namespace unnecessary_copy_tests UNORDERED_TEST(unnecessary_copy_emplace_rvalue_test, ((set)(multiset)(map)(multimap))) -#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL) +#if !defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_NO_VARIADIC_TEMPLATES) template void unnecessary_copy_emplace_move_test(T*) { @@ -199,7 +199,7 @@ namespace unnecessary_copy_tests x.emplace(source()); COPY_COUNT(1); MOVE_COUNT(0); -#if defined(BOOST_HAS_RVALUE_REFS) +#if !defined(BOOST_NO_RVALUE_REFERENCES) // No move should take place. reset(); x.emplace(std::move(a)); @@ -271,7 +271,7 @@ namespace unnecessary_copy_tests //x.emplace(a_ref); //COPY_COUNT(0); MOVE_COUNT(0); -#if defined(BOOST_HAS_RVALUE_REFS) +#if !defined(BOOST_NO_RVALUE_REFERENCES) // No move should take place. // (since a is already in the container) reset();