Unordered: Fix using a C++03 allocator with C++11 compiler.

Because the nodes had an implicit constructor, the `has_construct` traits was
detecting that the nodes could be constructed by construction then copy, which
really wasn't wanted. Also add a check that nodes aren't been copy constructed
to make sure this doesn't happen again. Refs #7100.

[SVN r79358]
This commit is contained in:
Daniel James committed 2012-07-08 11:55:57 +00:00
1 parent f387994422
commit 6932a2d571
2 files changed
+32 -4

No files matched your search

+16 -2
View File
@@ -37,7 +37,7 @@ namespace boost { namespace unordered { namespace detail {
#if BOOST_UNORDERED_DETAIL_FULL_CONSTRUCT
template <BOOST_UNORDERED_EMPLACE_TEMPLATE>
grouped_node(BOOST_UNORDERED_EMPLACE_ARGS) :
explicit grouped_node(BOOST_UNORDERED_EMPLACE_ARGS) :
node_base(),
group_prev_(),
hash_(0)
@@ -49,6 +49,10 @@ namespace boost { namespace unordered { namespace detail {
~grouped_node() {
boost::unordered::detail::destroy(this->value_ptr());
}
grouped_node(grouped_node const&) {
assert(false);
}
#else
grouped_node() :
node_base(),
@@ -61,6 +65,9 @@ namespace boost { namespace unordered { namespace detail {
{
group_prev_ = self;
}
private:
grouped_node& operator=(grouped_node const&);
};
template <typename T>
@@ -77,7 +84,7 @@ namespace boost { namespace unordered { namespace detail {
#if BOOST_UNORDERED_DETAIL_FULL_CONSTRUCT
template <BOOST_UNORDERED_EMPLACE_TEMPLATE>
grouped_ptr_node(BOOST_UNORDERED_EMPLACE_ARGS) :
explicit grouped_ptr_node(BOOST_UNORDERED_EMPLACE_ARGS) :
bucket_base(),
group_prev_(0),
hash_(0)
@@ -89,6 +96,10 @@ namespace boost { namespace unordered { namespace detail {
~grouped_ptr_node() {
boost::unordered::detail::destroy(this->value_ptr());
}
grouped_ptr_node(grouped_ptr_node const&) {
assert(false);
}
#else
grouped_ptr_node() :
bucket_base(),
@@ -101,6 +112,9 @@ namespace boost { namespace unordered { namespace detail {
{
group_prev_ = self;
}
private:
grouped_ptr_node& operator=(grouped_ptr_node const&);
};
// If the allocator uses raw pointers use grouped_ptr_node