From 060acb3f250f84eca898c49e3a5d4fd680a406e5 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 25 Oct 2009 10:55:08 +0000 Subject: [PATCH] Slightly rearrange the unordered container headers so that prev_prime is defined before it's used. [SVN r57152] --- include/boost/unordered/detail/buckets.hpp | 7 +++++++ include/boost/unordered/detail/fwd.hpp | 5 +---- include/boost/unordered/detail/table.hpp | 1 - test/unordered/Jamfile.v2 | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/boost/unordered/detail/buckets.hpp b/include/boost/unordered/detail/buckets.hpp index 0f513e44..c4b8a898 100644 --- a/include/boost/unordered/detail/buckets.hpp +++ b/include/boost/unordered/detail/buckets.hpp @@ -10,12 +10,19 @@ #include #include #include +#include namespace boost { namespace unordered_detail { //////////////////////////////////////////////////////////////////////////// // Buckets + template + inline std::size_t hash_buckets::max_bucket_count() const { + // -1 to account for the sentinel. + return prev_prime(this->bucket_alloc().max_size() - 1); + } + template inline BOOST_DEDUCED_TYPENAME hash_buckets::bucket_ptr hash_buckets::get_bucket(std::size_t num) const diff --git a/include/boost/unordered/detail/fwd.hpp b/include/boost/unordered/detail/fwd.hpp index 3a5e3f73..a7298780 100644 --- a/include/boost/unordered/detail/fwd.hpp +++ b/include/boost/unordered/detail/fwd.hpp @@ -298,10 +298,7 @@ namespace boost { namespace unordered_detail { return allocators_.first(); } node_allocator& node_alloc() { return allocators_.second(); } - std::size_t max_bucket_count() const { - // -1 to account for the sentinel. - return prev_prime(this->bucket_alloc().max_size() - 1); - } + std::size_t max_bucket_count() const; // Constructors diff --git a/include/boost/unordered/detail/table.hpp b/include/boost/unordered/detail/table.hpp index bba3a07f..66c9d744 100644 --- a/include/boost/unordered/detail/table.hpp +++ b/include/boost/unordered/detail/table.hpp @@ -14,7 +14,6 @@ #include #include -#include namespace boost { namespace unordered_detail { diff --git a/test/unordered/Jamfile.v2 b/test/unordered/Jamfile.v2 index d21e3da1..882ec132 100644 --- a/test/unordered/Jamfile.v2 +++ b/test/unordered/Jamfile.v2 @@ -11,7 +11,7 @@ project unordered-test/unordered intel:on intel:-strict-ansi msvc:/W4 - gcc:"-Wsign-promo -Wunused-parameter" + gcc:"-Wsign-promo -Wunused-parameter -pedantic" ; test-suite unordered