diff --git a/include/boost/unordered/detail/buckets.hpp b/include/boost/unordered/detail/buckets.hpp index ffa59560..ed100dff 100644 --- a/include/boost/unordered/detail/buckets.hpp +++ b/include/boost/unordered/detail/buckets.hpp @@ -15,7 +15,7 @@ namespace boost { namespace unordered { namespace detail { // // Now the main data structure: // - // buckets buffered_functions + // buckets functions // | | // +---------------+--------------+ // | @@ -323,10 +323,10 @@ namespace boost { namespace unordered { namespace detail { template class set_hash_functions; template - class buffered_functions + class functions { friend class set_hash_functions; - buffered_functions& operator=(buffered_functions const&); + functions& operator=(functions const&); typedef ::boost::compressed_pair function_pair; typedef BOOST_DEDUCED_TYPENAME ::boost::aligned_storage< @@ -358,19 +358,19 @@ namespace boost { namespace unordered { namespace detail { public: - buffered_functions(H const& hf, P const& eq) + functions(H const& hf, P const& eq) : current_(false) { construct(current_, hf, eq); } - buffered_functions(buffered_functions const& bf) + functions(functions const& bf) : current_(false) { construct(current_, bf.current()); } - ~buffered_functions() { + ~functions() { destroy(current_); } @@ -389,22 +389,20 @@ namespace boost { namespace unordered { namespace detail { set_hash_functions(set_hash_functions const&); set_hash_functions& operator=(set_hash_functions const&); - typedef buffered_functions buffered_functions; - buffered_functions& buffered_functions_; + functions& functions_; bool tmp_functions_; public: - set_hash_functions(buffered_functions& f, H const& h, P const& p) - : buffered_functions_(f), + set_hash_functions(functions& f, H const& h, P const& p) + : functions_(f), tmp_functions_(!f.current_) { f.construct(tmp_functions_, h, p); } - set_hash_functions(buffered_functions& f, - buffered_functions const& other) - : buffered_functions_(f), + set_hash_functions(functions& f, functions const& other) + : functions_(f), tmp_functions_(!f.current_) { f.construct(tmp_functions_, other.current()); @@ -412,12 +410,12 @@ namespace boost { namespace unordered { namespace detail { ~set_hash_functions() { - buffered_functions_.destroy(tmp_functions_); + functions_.destroy(tmp_functions_); } void commit() { - buffered_functions_.current_ = tmp_functions_; + functions_.current_ = tmp_functions_; tmp_functions_ = !tmp_functions_; } }; diff --git a/include/boost/unordered/detail/equivalent.hpp b/include/boost/unordered/detail/equivalent.hpp index 9da99ba7..9cf3bb0f 100644 --- a/include/boost/unordered/detail/equivalent.hpp +++ b/include/boost/unordered/detail/equivalent.hpp @@ -12,7 +12,7 @@ namespace boost { namespace unordered { namespace detail { template - class equivalent_table : public T::table + class equivalent_table : public T::table_base { public: typedef BOOST_DEDUCED_TYPENAME T::hasher hasher; @@ -20,7 +20,7 @@ namespace boost { namespace unordered { namespace detail { typedef BOOST_DEDUCED_TYPENAME T::value_allocator value_allocator; typedef BOOST_DEDUCED_TYPENAME T::key_type key_type; typedef BOOST_DEDUCED_TYPENAME T::value_type value_type; - typedef BOOST_DEDUCED_TYPENAME T::table table; + typedef BOOST_DEDUCED_TYPENAME T::table_base table_base; typedef BOOST_DEDUCED_TYPENAME T::node_constructor node_constructor; typedef BOOST_DEDUCED_TYPENAME T::node node; @@ -32,17 +32,17 @@ namespace boost { namespace unordered { namespace detail { equivalent_table(std::size_t n, hasher const& hf, key_equal const& eq, value_allocator const& a) - : table(n, hf, eq, a) {} + : table_base(n, hf, eq, a) {} equivalent_table(equivalent_table const& x) - : table(x, x.node_alloc()) {} + : table_base(x, x.node_alloc()) {} equivalent_table(equivalent_table const& x, value_allocator const& a) - : table(x, a) {} + : table_base(x, a) {} equivalent_table(equivalent_table& x, move_tag m) - : table(x, m) {} + : table_base(x, m) {} equivalent_table(equivalent_table& x, value_allocator const& a, move_tag m) - : table(x, a, m) {} + : table_base(x, a, m) {} ~equivalent_table() {} // Equality @@ -237,7 +237,7 @@ namespace boost { namespace unordered { namespace detail { false> { typedef equivalent_table > impl; - typedef table > table; + typedef table > table_base; }; template @@ -248,7 +248,7 @@ namespace boost { namespace unordered { namespace detail { false> { typedef equivalent_table > impl; - typedef table > table; + typedef table > table_base; }; }}} diff --git a/include/boost/unordered/detail/table.hpp b/include/boost/unordered/detail/table.hpp index 07acb148..92cc9560 100644 --- a/include/boost/unordered/detail/table.hpp +++ b/include/boost/unordered/detail/table.hpp @@ -18,7 +18,7 @@ namespace boost { namespace unordered { namespace detail { // their declaration and implementation. template - class table : public T::buckets, public T::buffered_functions + class table : public T::buckets, public T::functions { table(table const&); public: @@ -27,7 +27,7 @@ namespace boost { namespace unordered { namespace detail { typedef BOOST_DEDUCED_TYPENAME T::value_allocator value_allocator; typedef BOOST_DEDUCED_TYPENAME T::key_type key_type; typedef BOOST_DEDUCED_TYPENAME T::value_type value_type; - typedef BOOST_DEDUCED_TYPENAME T::buffered_functions base; + typedef BOOST_DEDUCED_TYPENAME T::functions functions; typedef BOOST_DEDUCED_TYPENAME T::buckets buckets; typedef BOOST_DEDUCED_TYPENAME T::extractor extractor; typedef BOOST_DEDUCED_TYPENAME T::node_constructor node_constructor; @@ -182,7 +182,7 @@ namespace boost { namespace unordered { namespace detail { key_equal const& eq, node_allocator const& a) : buckets(a, next_prime(num_buckets)), - base(hf, eq), + functions(hf, eq), size_(), mlf_(1.0f), max_load_(0) @@ -191,7 +191,7 @@ namespace boost { namespace unordered { namespace detail { table(table const& x, node_allocator const& a) : buckets(a, x.min_buckets_for_size(x.size_)), - base(x), + functions(x), size_(x.size_), mlf_(x.mlf_), max_load_(0) @@ -204,7 +204,7 @@ namespace boost { namespace unordered { namespace detail { table(table& x, move_tag) : buckets(x.node_alloc(), x.bucket_count_), - base(x), + functions(x), size_(0), mlf_(1.0f), max_load_(0) @@ -214,7 +214,7 @@ namespace boost { namespace unordered { namespace detail { table(table& x, node_allocator const& a, move_tag) : buckets(a, x.bucket_count_), - base(x), + functions(x), size_(0), mlf_(x.mlf_), max_load_(0) @@ -579,7 +579,7 @@ namespace boost { namespace unordered { namespace detail { typedef ::boost::unordered::detail::node_constructor node_constructor; typedef ::boost::unordered::detail::buckets buckets; - typedef ::boost::unordered::detail::buffered_functions buffered_functions; + typedef ::boost::unordered::detail::functions functions; typedef BOOST_DEDUCED_TYPENAME buckets::node node; typedef BOOST_DEDUCED_TYPENAME buckets::bucket bucket; diff --git a/include/boost/unordered/detail/unique.hpp b/include/boost/unordered/detail/unique.hpp index 988e3a3a..ac280671 100644 --- a/include/boost/unordered/detail/unique.hpp +++ b/include/boost/unordered/detail/unique.hpp @@ -12,7 +12,7 @@ namespace boost { namespace unordered { namespace detail { template - class unique_table : public T::table + class unique_table : public T::table_base { public: typedef BOOST_DEDUCED_TYPENAME T::hasher hasher; @@ -20,7 +20,7 @@ namespace boost { namespace unordered { namespace detail { typedef BOOST_DEDUCED_TYPENAME T::value_allocator value_allocator; typedef BOOST_DEDUCED_TYPENAME T::key_type key_type; typedef BOOST_DEDUCED_TYPENAME T::value_type value_type; - typedef BOOST_DEDUCED_TYPENAME T::table table; + typedef BOOST_DEDUCED_TYPENAME T::table_base table_base; typedef BOOST_DEDUCED_TYPENAME T::node_constructor node_constructor; typedef BOOST_DEDUCED_TYPENAME T::node node; @@ -34,16 +34,16 @@ namespace boost { namespace unordered { namespace detail { unique_table(std::size_t n, hasher const& hf, key_equal const& eq, value_allocator const& a) - : table(n, hf, eq, a) {} + : table_base(n, hf, eq, a) {} unique_table(unique_table const& x) - : table(x, x.node_alloc()) {} + : table_base(x, x.node_alloc()) {} unique_table(unique_table const& x, value_allocator const& a) - : table(x, a) {} + : table_base(x, a) {} unique_table(unique_table& x, move_tag m) - : table(x, m) {} + : table_base(x, m) {} unique_table(unique_table& x, value_allocator const& a, move_tag m) - : table(x, a, m) {} + : table_base(x, a, m) {} ~unique_table() {} // equals @@ -379,7 +379,7 @@ namespace boost { namespace unordered { namespace detail { true> { typedef ::boost::unordered::detail::unique_table > impl; - typedef ::boost::unordered::detail::table > table; + typedef ::boost::unordered::detail::table > table_base; }; template @@ -390,7 +390,7 @@ namespace boost { namespace unordered { namespace detail { true> { typedef ::boost::unordered::detail::unique_table > impl; - typedef ::boost::unordered::detail::table > table; + typedef ::boost::unordered::detail::table > table_base; }; }}}