forked from boostorg/unordered
Unordered: fix some gcc issues.
[SVN r71346]
This commit is contained in:
@ -15,7 +15,7 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
//
|
//
|
||||||
// Now the main data structure:
|
// Now the main data structure:
|
||||||
//
|
//
|
||||||
// buckets<A, Unique> buffered_functions<H, P>
|
// buckets<A, Unique> functions<H, P>
|
||||||
// | |
|
// | |
|
||||||
// +---------------+--------------+
|
// +---------------+--------------+
|
||||||
// |
|
// |
|
||||||
@ -323,10 +323,10 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
template <class H, class P> class set_hash_functions;
|
template <class H, class P> class set_hash_functions;
|
||||||
|
|
||||||
template <class H, class P>
|
template <class H, class P>
|
||||||
class buffered_functions
|
class functions
|
||||||
{
|
{
|
||||||
friend class set_hash_functions<H, P>;
|
friend class set_hash_functions<H, P>;
|
||||||
buffered_functions& operator=(buffered_functions const&);
|
functions& operator=(functions const&);
|
||||||
|
|
||||||
typedef ::boost::compressed_pair<H, P> function_pair;
|
typedef ::boost::compressed_pair<H, P> function_pair;
|
||||||
typedef BOOST_DEDUCED_TYPENAME ::boost::aligned_storage<
|
typedef BOOST_DEDUCED_TYPENAME ::boost::aligned_storage<
|
||||||
@ -358,19 +358,19 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
buffered_functions(H const& hf, P const& eq)
|
functions(H const& hf, P const& eq)
|
||||||
: current_(false)
|
: current_(false)
|
||||||
{
|
{
|
||||||
construct(current_, hf, eq);
|
construct(current_, hf, eq);
|
||||||
}
|
}
|
||||||
|
|
||||||
buffered_functions(buffered_functions const& bf)
|
functions(functions const& bf)
|
||||||
: current_(false)
|
: current_(false)
|
||||||
{
|
{
|
||||||
construct(current_, bf.current());
|
construct(current_, bf.current());
|
||||||
}
|
}
|
||||||
|
|
||||||
~buffered_functions() {
|
~functions() {
|
||||||
destroy(current_);
|
destroy(current_);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -389,22 +389,20 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
set_hash_functions(set_hash_functions const&);
|
set_hash_functions(set_hash_functions const&);
|
||||||
set_hash_functions& operator=(set_hash_functions const&);
|
set_hash_functions& operator=(set_hash_functions const&);
|
||||||
|
|
||||||
typedef buffered_functions<H, P> buffered_functions;
|
functions<H,P>& functions_;
|
||||||
buffered_functions& buffered_functions_;
|
|
||||||
bool tmp_functions_;
|
bool tmp_functions_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
set_hash_functions(buffered_functions& f, H const& h, P const& p)
|
set_hash_functions(functions<H,P>& f, H const& h, P const& p)
|
||||||
: buffered_functions_(f),
|
: functions_(f),
|
||||||
tmp_functions_(!f.current_)
|
tmp_functions_(!f.current_)
|
||||||
{
|
{
|
||||||
f.construct(tmp_functions_, h, p);
|
f.construct(tmp_functions_, h, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
set_hash_functions(buffered_functions& f,
|
set_hash_functions(functions<H,P>& f, functions<H,P> const& other)
|
||||||
buffered_functions const& other)
|
: functions_(f),
|
||||||
: buffered_functions_(f),
|
|
||||||
tmp_functions_(!f.current_)
|
tmp_functions_(!f.current_)
|
||||||
{
|
{
|
||||||
f.construct(tmp_functions_, other.current());
|
f.construct(tmp_functions_, other.current());
|
||||||
@ -412,12 +410,12 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
|
|
||||||
~set_hash_functions()
|
~set_hash_functions()
|
||||||
{
|
{
|
||||||
buffered_functions_.destroy(tmp_functions_);
|
functions_.destroy(tmp_functions_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void commit()
|
void commit()
|
||||||
{
|
{
|
||||||
buffered_functions_.current_ = tmp_functions_;
|
functions_.current_ = tmp_functions_;
|
||||||
tmp_functions_ = !tmp_functions_;
|
tmp_functions_ = !tmp_functions_;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
namespace boost { namespace unordered { namespace detail {
|
namespace boost { namespace unordered { namespace detail {
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
class equivalent_table : public T::table
|
class equivalent_table : public T::table_base
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef BOOST_DEDUCED_TYPENAME T::hasher hasher;
|
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::value_allocator value_allocator;
|
||||||
typedef BOOST_DEDUCED_TYPENAME T::key_type key_type;
|
typedef BOOST_DEDUCED_TYPENAME T::key_type key_type;
|
||||||
typedef BOOST_DEDUCED_TYPENAME T::value_type value_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_constructor node_constructor;
|
||||||
|
|
||||||
typedef BOOST_DEDUCED_TYPENAME T::node node;
|
typedef BOOST_DEDUCED_TYPENAME T::node node;
|
||||||
@ -32,17 +32,17 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
|
|
||||||
equivalent_table(std::size_t n,
|
equivalent_table(std::size_t n,
|
||||||
hasher const& hf, key_equal const& eq, value_allocator const& a)
|
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)
|
equivalent_table(equivalent_table const& x)
|
||||||
: table(x, x.node_alloc()) {}
|
: table_base(x, x.node_alloc()) {}
|
||||||
equivalent_table(equivalent_table const& x,
|
equivalent_table(equivalent_table const& x,
|
||||||
value_allocator const& a)
|
value_allocator const& a)
|
||||||
: table(x, a) {}
|
: table_base(x, a) {}
|
||||||
equivalent_table(equivalent_table& x, move_tag m)
|
equivalent_table(equivalent_table& x, move_tag m)
|
||||||
: table(x, m) {}
|
: table_base(x, m) {}
|
||||||
equivalent_table(equivalent_table& x,
|
equivalent_table(equivalent_table& x,
|
||||||
value_allocator const& a, move_tag m)
|
value_allocator const& a, move_tag m)
|
||||||
: table(x, a, m) {}
|
: table_base(x, a, m) {}
|
||||||
~equivalent_table() {}
|
~equivalent_table() {}
|
||||||
|
|
||||||
// Equality
|
// Equality
|
||||||
@ -237,7 +237,7 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
false>
|
false>
|
||||||
{
|
{
|
||||||
typedef equivalent_table<multiset<H, P, A> > impl;
|
typedef equivalent_table<multiset<H, P, A> > impl;
|
||||||
typedef table<multiset<H, P, A> > table;
|
typedef table<multiset<H, P, A> > table_base;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class K, class H, class P, class A>
|
template <class K, class H, class P, class A>
|
||||||
@ -248,7 +248,7 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
false>
|
false>
|
||||||
{
|
{
|
||||||
typedef equivalent_table<multimap<K, H, P, A> > impl;
|
typedef equivalent_table<multimap<K, H, P, A> > impl;
|
||||||
typedef table<multimap<K, H, P, A> > table;
|
typedef table<multimap<K, H, P, A> > table_base;
|
||||||
};
|
};
|
||||||
}}}
|
}}}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
// their declaration and implementation.
|
// their declaration and implementation.
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
class table : public T::buckets, public T::buffered_functions
|
class table : public T::buckets, public T::functions
|
||||||
{
|
{
|
||||||
table(table const&);
|
table(table const&);
|
||||||
public:
|
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::value_allocator value_allocator;
|
||||||
typedef BOOST_DEDUCED_TYPENAME T::key_type key_type;
|
typedef BOOST_DEDUCED_TYPENAME T::key_type key_type;
|
||||||
typedef BOOST_DEDUCED_TYPENAME T::value_type value_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::buckets buckets;
|
||||||
typedef BOOST_DEDUCED_TYPENAME T::extractor extractor;
|
typedef BOOST_DEDUCED_TYPENAME T::extractor extractor;
|
||||||
typedef BOOST_DEDUCED_TYPENAME T::node_constructor node_constructor;
|
typedef BOOST_DEDUCED_TYPENAME T::node_constructor node_constructor;
|
||||||
@ -182,7 +182,7 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
key_equal const& eq,
|
key_equal const& eq,
|
||||||
node_allocator const& a)
|
node_allocator const& a)
|
||||||
: buckets(a, next_prime(num_buckets)),
|
: buckets(a, next_prime(num_buckets)),
|
||||||
base(hf, eq),
|
functions(hf, eq),
|
||||||
size_(),
|
size_(),
|
||||||
mlf_(1.0f),
|
mlf_(1.0f),
|
||||||
max_load_(0)
|
max_load_(0)
|
||||||
@ -191,7 +191,7 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
|
|
||||||
table(table const& x, node_allocator const& a)
|
table(table const& x, node_allocator const& a)
|
||||||
: buckets(a, x.min_buckets_for_size(x.size_)),
|
: buckets(a, x.min_buckets_for_size(x.size_)),
|
||||||
base(x),
|
functions(x),
|
||||||
size_(x.size_),
|
size_(x.size_),
|
||||||
mlf_(x.mlf_),
|
mlf_(x.mlf_),
|
||||||
max_load_(0)
|
max_load_(0)
|
||||||
@ -204,7 +204,7 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
|
|
||||||
table(table& x, move_tag)
|
table(table& x, move_tag)
|
||||||
: buckets(x.node_alloc(), x.bucket_count_),
|
: buckets(x.node_alloc(), x.bucket_count_),
|
||||||
base(x),
|
functions(x),
|
||||||
size_(0),
|
size_(0),
|
||||||
mlf_(1.0f),
|
mlf_(1.0f),
|
||||||
max_load_(0)
|
max_load_(0)
|
||||||
@ -214,7 +214,7 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
|
|
||||||
table(table& x, node_allocator const& a, move_tag)
|
table(table& x, node_allocator const& a, move_tag)
|
||||||
: buckets(a, x.bucket_count_),
|
: buckets(a, x.bucket_count_),
|
||||||
base(x),
|
functions(x),
|
||||||
size_(0),
|
size_(0),
|
||||||
mlf_(x.mlf_),
|
mlf_(x.mlf_),
|
||||||
max_load_(0)
|
max_load_(0)
|
||||||
@ -579,7 +579,7 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
|
|
||||||
typedef ::boost::unordered::detail::node_constructor<value_allocator, Unique> node_constructor;
|
typedef ::boost::unordered::detail::node_constructor<value_allocator, Unique> node_constructor;
|
||||||
typedef ::boost::unordered::detail::buckets<value_allocator, Unique> buckets;
|
typedef ::boost::unordered::detail::buckets<value_allocator, Unique> buckets;
|
||||||
typedef ::boost::unordered::detail::buffered_functions<hasher, key_equal> buffered_functions;
|
typedef ::boost::unordered::detail::functions<hasher, key_equal> functions;
|
||||||
|
|
||||||
typedef BOOST_DEDUCED_TYPENAME buckets::node node;
|
typedef BOOST_DEDUCED_TYPENAME buckets::node node;
|
||||||
typedef BOOST_DEDUCED_TYPENAME buckets::bucket bucket;
|
typedef BOOST_DEDUCED_TYPENAME buckets::bucket bucket;
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
namespace boost { namespace unordered { namespace detail {
|
namespace boost { namespace unordered { namespace detail {
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
class unique_table : public T::table
|
class unique_table : public T::table_base
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef BOOST_DEDUCED_TYPENAME T::hasher hasher;
|
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::value_allocator value_allocator;
|
||||||
typedef BOOST_DEDUCED_TYPENAME T::key_type key_type;
|
typedef BOOST_DEDUCED_TYPENAME T::key_type key_type;
|
||||||
typedef BOOST_DEDUCED_TYPENAME T::value_type value_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_constructor node_constructor;
|
||||||
|
|
||||||
typedef BOOST_DEDUCED_TYPENAME T::node node;
|
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,
|
unique_table(std::size_t n, hasher const& hf, key_equal const& eq,
|
||||||
value_allocator const& a)
|
value_allocator const& a)
|
||||||
: table(n, hf, eq, a) {}
|
: table_base(n, hf, eq, a) {}
|
||||||
unique_table(unique_table const& x)
|
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)
|
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)
|
unique_table(unique_table& x, move_tag m)
|
||||||
: table(x, m) {}
|
: table_base(x, m) {}
|
||||||
unique_table(unique_table& x, value_allocator const& a,
|
unique_table(unique_table& x, value_allocator const& a,
|
||||||
move_tag m)
|
move_tag m)
|
||||||
: table(x, a, m) {}
|
: table_base(x, a, m) {}
|
||||||
~unique_table() {}
|
~unique_table() {}
|
||||||
|
|
||||||
// equals
|
// equals
|
||||||
@ -379,7 +379,7 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
true>
|
true>
|
||||||
{
|
{
|
||||||
typedef ::boost::unordered::detail::unique_table<set<H, P, A> > impl;
|
typedef ::boost::unordered::detail::unique_table<set<H, P, A> > impl;
|
||||||
typedef ::boost::unordered::detail::table<set<H, P, A> > table;
|
typedef ::boost::unordered::detail::table<set<H, P, A> > table_base;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class K, class H, class P, class A>
|
template <class K, class H, class P, class A>
|
||||||
@ -390,7 +390,7 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
true>
|
true>
|
||||||
{
|
{
|
||||||
typedef ::boost::unordered::detail::unique_table<map<K, H, P, A> > impl;
|
typedef ::boost::unordered::detail::unique_table<map<K, H, P, A> > impl;
|
||||||
typedef ::boost::unordered::detail::table<map<K, H, P, A> > table;
|
typedef ::boost::unordered::detail::table<map<K, H, P, A> > table_base;
|
||||||
};
|
};
|
||||||
}}}
|
}}}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user