Expand calls to clear implementation

This commit is contained in:
Daniel James
2017-04-23 10:09:18 +01:00
parent f6f5ecdc00
commit 814926ef31
3 changed files with 29 additions and 24 deletions

View File

@@ -53,6 +53,7 @@ template <class T, class H, class P, class A> class unordered_set
typedef boost::unordered::detail::set<A, T, H, P> types;
typedef typename types::value_allocator_traits value_allocator_traits;
typedef typename types::table table;
typedef typename table::link_pointer link_pointer;
public:
typedef typename value_allocator_traits::pointer pointer;
@@ -562,6 +563,7 @@ template <class T, class H, class P, class A> class unordered_multiset
typedef boost::unordered::detail::multiset<A, T, H, P> types;
typedef typename types::value_allocator_traits value_allocator_traits;
typedef typename types::table table;
typedef typename table::link_pointer link_pointer;
public:
typedef typename value_allocator_traits::pointer pointer;
@@ -1179,7 +1181,7 @@ template <class T, class H, class P, class A>
unordered_set<T, H, P, A>& unordered_set<T, H, P, A>::operator=(
std::initializer_list<value_type> list)
{
table_.clear();
this->clear();
table_.insert_range(list.begin(), list.end());
return *this;
}
@@ -1245,13 +1247,10 @@ void unordered_set<T, H, P, A>::swap(unordered_set& other)
template <class T, class H, class P, class A>
void unordered_set<T, H, P, A>::clear() BOOST_NOEXCEPT
{
table_.clear();
}
template <class T, class H, class P, class A>
void unordered_multiset<T, H, P, A>::clear() BOOST_NOEXCEPT
{
table_.clear();
if (table_.size_) {
table_.clear_buckets();
table_.delete_nodes(table_.get_previous_start(), link_pointer());
}
}
// observers
@@ -1553,7 +1552,7 @@ template <class T, class H, class P, class A>
unordered_multiset<T, H, P, A>& unordered_multiset<T, H, P, A>::operator=(
std::initializer_list<value_type> list)
{
table_.clear();
this->clear();
table_.insert_range(list.begin(), list.end());
return *this;
}
@@ -1617,6 +1616,15 @@ void unordered_multiset<T, H, P, A>::swap(unordered_multiset& other)
table_.swap(other.table_);
}
template <class T, class H, class P, class A>
void unordered_multiset<T, H, P, A>::clear() BOOST_NOEXCEPT
{
if (table_.size_) {
table_.clear_buckets();
table_.delete_nodes(table_.get_previous_start(), link_pointer());
}
}
// observers
template <class T, class H, class P, class A>