mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 03:17:15 +02:00
Refactor the hash table implementation a little bit. Some of the changes are to
make implementing emplace easier. Merged revisions 44458-44460,44463-44465 via svnmerge from https://svn.boost.org/svn/boost/branches/unordered/trunk ........ r44458 | danieljames | 2008-04-16 18:31:35 +0100 (Wed, 16 Apr 2008) | 2 lines Pull out the buffered functions. ........ r44459 | danieljames | 2008-04-16 18:31:45 +0100 (Wed, 16 Apr 2008) | 4 lines Inline construct_node and create_node into copy_group - these used to be used in the implementation of insert but aren't now because of insert's exception requirements, so keeping them around was just confusing. ........ r44460 | danieljames | 2008-04-16 18:31:54 +0100 (Wed, 16 Apr 2008) | 4 lines Change link_node so that it takes a node_constructor containing a constructed node instead of a node - this makes the code a little cleaner and also simplifies exception safety. ........ r44463 | danieljames | 2008-04-16 18:35:11 +0100 (Wed, 16 Apr 2008) | 2 lines Explicitly name the different insert overloads. ........ r44464 | danieljames | 2008-04-16 18:35:22 +0100 (Wed, 16 Apr 2008) | 2 lines Explicitly name the different erase overloads. ........ r44465 | danieljames | 2008-04-16 18:35:33 +0100 (Wed, 16 Apr 2008) | 2 lines Call the erase methods in hash_table_data directly. ........ [SVN r44489]
This commit is contained in:
@ -207,28 +207,28 @@ namespace boost
|
||||
|
||||
iterator insert(const_iterator hint, const value_type& obj)
|
||||
{
|
||||
return iterator(base.insert(get(hint), obj));
|
||||
return iterator(base.insert_hint(get(hint), obj));
|
||||
}
|
||||
|
||||
template <class InputIterator>
|
||||
void insert(InputIterator first, InputIterator last)
|
||||
{
|
||||
base.insert(first, last);
|
||||
base.insert_range(first, last);
|
||||
}
|
||||
|
||||
iterator erase(const_iterator position)
|
||||
{
|
||||
return iterator(base.erase(get(position)));
|
||||
return iterator(base.data_.erase(get(position)));
|
||||
}
|
||||
|
||||
size_type erase(const key_type& k)
|
||||
{
|
||||
return base.erase(k);
|
||||
return base.erase_key(k);
|
||||
}
|
||||
|
||||
iterator erase(const_iterator first, const_iterator last)
|
||||
{
|
||||
return iterator(base.erase(get(first), get(last)));
|
||||
return iterator(base.data_.erase_range(get(first), get(last)));
|
||||
}
|
||||
|
||||
void clear()
|
||||
@ -560,28 +560,28 @@ namespace boost
|
||||
|
||||
iterator insert(const_iterator hint, const value_type& obj)
|
||||
{
|
||||
return iterator(base.insert(get(hint), obj));
|
||||
return iterator(base.insert_hint(get(hint), obj));
|
||||
}
|
||||
|
||||
template <class InputIterator>
|
||||
void insert(InputIterator first, InputIterator last)
|
||||
{
|
||||
base.insert(first, last);
|
||||
base.insert_range(first, last);
|
||||
}
|
||||
|
||||
iterator erase(const_iterator position)
|
||||
{
|
||||
return iterator(base.erase(get(position)));
|
||||
return iterator(base.data_.erase(get(position)));
|
||||
}
|
||||
|
||||
size_type erase(const key_type& k)
|
||||
{
|
||||
return base.erase(k);
|
||||
return base.erase_key(k);
|
||||
}
|
||||
|
||||
iterator erase(const_iterator first, const_iterator last)
|
||||
{
|
||||
return iterator(base.erase(get(first), get(last)));
|
||||
return iterator(base.data_.erase_range(get(first), get(last)));
|
||||
}
|
||||
|
||||
void clear()
|
||||
|
Reference in New Issue
Block a user