forked from boostorg/unordered
Merge unordred changes.
Merged revisions 56441,56461,56468,56557-56562 via svnmerge from https://svn.boost.org/svn/boost/trunk ........ r56441 | danieljames | 2009-09-27 20:12:04 +0100 (Sun, 27 Sep 2009) | 1 line Try supporting reference parameters in pairs. Probably not required. ........ r56461 | danieljames | 2009-09-29 00:06:03 +0100 (Tue, 29 Sep 2009) | 1 line Remove the optimization for std::pair with a key reference. It'll be too much hassle to get a very unusual use case to work on all compilers. ........ r56468 | danieljames | 2009-09-29 08:46:44 +0100 (Tue, 29 Sep 2009) | 1 line Just remove the test since the test itself doesn't work on most compilers. ........ r56557 | danieljames | 2009-10-03 17:40:26 +0100 (Sat, 03 Oct 2009) | 1 line Fix the iterator category. ........ r56558 | danieljames | 2009-10-03 17:40:53 +0100 (Sat, 03 Oct 2009) | 2 lines Update reference docs to latest version of draft standard and fill in some missing details. ........ r56559 | danieljames | 2009-10-03 17:41:11 +0100 (Sat, 03 Oct 2009) | 1 line Stricter insert exception tests. ........ r56560 | danieljames | 2009-10-03 17:41:32 +0100 (Sat, 03 Oct 2009) | 1 line Insert using initializer lists. ........ r56561 | danieljames | 2009-10-03 17:42:00 +0100 (Sat, 03 Oct 2009) | 1 line Update the unordered rationale. ........ r56562 | danieljames | 2009-10-03 17:42:20 +0100 (Sat, 03 Oct 2009) | 1 line Make sure inserting from a range of types other than the value type is better tested. ........ [SVN r56700]
This commit is contained in:
@@ -106,21 +106,6 @@ namespace unordered_detail {
|
||||
{
|
||||
return v.first;
|
||||
}
|
||||
/*
|
||||
template <class Second>
|
||||
static key_type const& extract(
|
||||
std::pair<key_type&, Second> const& v)
|
||||
{
|
||||
return v.first;
|
||||
}
|
||||
|
||||
template <class Second>
|
||||
static key_type const& extract(
|
||||
std::pair<key_type const&, Second> const& v)
|
||||
{
|
||||
return v.first;
|
||||
}
|
||||
*/
|
||||
|
||||
#if defined(BOOST_UNORDERED_STD_FORWARD)
|
||||
template <class Arg1, class... Args>
|
||||
|
||||
@@ -324,10 +324,9 @@ namespace boost { namespace unordered_detail {
|
||||
|
||||
do {
|
||||
// No side effects in this initial code
|
||||
// Note: can't use get_key as '*i' might not be value_type.
|
||||
// TODO: Check if std::pair has an appropriate constructor. If not
|
||||
// that might not be true.
|
||||
// TODO: Test this line better.
|
||||
// Note: can't use get_key as '*i' might not be value_type - it could
|
||||
// be a pair with first_types as key_type without const or a
|
||||
// different second_type.
|
||||
key_type const& k = extractor::extract(*i);
|
||||
std::size_t hash_value = this->hash_function()(k);
|
||||
bucket_ptr bucket = this->bucket_ptr_from_hash(hash_value);
|
||||
|
||||
@@ -343,6 +343,13 @@ namespace boost
|
||||
table_.insert_range(first, last);
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
|
||||
void insert(std::initializer_list<value_type> list)
|
||||
{
|
||||
table_.insert_range(list.begin(), list.end());
|
||||
}
|
||||
#endif
|
||||
|
||||
iterator erase(const_iterator position)
|
||||
{
|
||||
return iterator(table_.erase(get(position)));
|
||||
@@ -837,6 +844,13 @@ namespace boost
|
||||
table_.insert_range(first, last);
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
|
||||
void insert(std::initializer_list<value_type> list)
|
||||
{
|
||||
table_.insert_range(list.begin(), list.end());
|
||||
}
|
||||
#endif
|
||||
|
||||
iterator erase(const_iterator position)
|
||||
{
|
||||
return iterator(table_.erase(get(position)));
|
||||
|
||||
@@ -337,6 +337,13 @@ namespace boost
|
||||
table_.insert_range(first, last);
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
|
||||
void insert(std::initializer_list<value_type> list)
|
||||
{
|
||||
table_.insert_range(list.begin(), list.end());
|
||||
}
|
||||
#endif
|
||||
|
||||
iterator erase(const_iterator position)
|
||||
{
|
||||
return iterator(table_.erase(get(position)));
|
||||
@@ -793,6 +800,13 @@ namespace boost
|
||||
table_.insert_range(first, last);
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
|
||||
void insert(std::initializer_list<value_type> list)
|
||||
{
|
||||
table_.insert_range(list.begin(), list.end());
|
||||
}
|
||||
#endif
|
||||
|
||||
iterator erase(const_iterator position)
|
||||
{
|
||||
return iterator(table_.erase(get(position)));
|
||||
|
||||
Reference in New Issue
Block a user