hashtable.h (_Hashtable<>::insert(value_type&&), [...]): Don't define here...
2011-10-03 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h (_Hashtable<>::insert(value_type&&), insert(const_iterator, value_type&&)): Don't define here... * include/bits/unordered_set.h (__unordered_set<>, __unordered_multiset<>): ... define here instead. From-SVN: r179464
This commit is contained in:
parent
f90e8e2eae
commit
1c29961267
@ -1,7 +1,14 @@
|
||||
2011-10-03 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
* include/bits/hashtable.h (_Hashtable<>::insert(value_type&&),
|
||||
insert(const_iterator, value_type&&)): Don't define here...
|
||||
* include/bits/unordered_set.h (__unordered_set<>,
|
||||
__unordered_multiset<>): ... define here instead.
|
||||
|
||||
2011-09-29 Jason Merrill <jason@redhat.com>
|
||||
|
||||
* testsuite/util/testsuite_tr1.h (test_property): Avoid
|
||||
ambguity.
|
||||
ambiguity.
|
||||
|
||||
2011-10-01 François Dumont <fdumont@gcc.gnu.org>
|
||||
|
||||
|
@ -374,14 +374,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
_M_insert_bucket(_Arg&&, size_type,
|
||||
typename _Hashtable::_Hash_code_type);
|
||||
|
||||
template<typename _Arg>
|
||||
std::pair<iterator, bool>
|
||||
_M_insert(_Arg&&, std::true_type);
|
||||
|
||||
template<typename _Arg>
|
||||
iterator
|
||||
_M_insert(_Arg&&, std::false_type);
|
||||
|
||||
typedef typename std::conditional<__unique_keys,
|
||||
std::pair<iterator, bool>,
|
||||
iterator>::type
|
||||
@ -393,38 +385,38 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
>::type
|
||||
_Insert_Conv_Type;
|
||||
|
||||
protected:
|
||||
template<typename _Arg>
|
||||
std::pair<iterator, bool>
|
||||
_M_insert(_Arg&&, std::true_type);
|
||||
|
||||
template<typename _Arg>
|
||||
iterator
|
||||
_M_insert(_Arg&&, std::false_type);
|
||||
|
||||
public:
|
||||
// Insert and erase
|
||||
_Insert_Return_Type
|
||||
insert(const value_type& __v)
|
||||
{ return _M_insert(__v, std::integral_constant<bool, __unique_keys>()); }
|
||||
{ return _M_insert(__v, integral_constant<bool, __unique_keys>()); }
|
||||
|
||||
iterator
|
||||
insert(const_iterator, const value_type& __v)
|
||||
{ return _Insert_Conv_Type()(insert(__v)); }
|
||||
|
||||
_Insert_Return_Type
|
||||
insert(value_type&& __v)
|
||||
{ return _M_insert(std::move(__v),
|
||||
std::integral_constant<bool, __unique_keys>()); }
|
||||
|
||||
iterator
|
||||
insert(const_iterator, value_type&& __v)
|
||||
{ return _Insert_Conv_Type()(insert(std::move(__v))); }
|
||||
|
||||
template<typename _Pair, typename = typename
|
||||
std::enable_if<!__constant_iterators
|
||||
&& std::is_convertible<_Pair,
|
||||
value_type>::value>::type>
|
||||
std::enable_if<__and_<integral_constant<bool, !__constant_iterators>,
|
||||
std::is_convertible<_Pair,
|
||||
value_type>>::value>::type>
|
||||
_Insert_Return_Type
|
||||
insert(_Pair&& __v)
|
||||
{ return _M_insert(std::forward<_Pair>(__v),
|
||||
std::integral_constant<bool, __unique_keys>()); }
|
||||
integral_constant<bool, __unique_keys>()); }
|
||||
|
||||
template<typename _Pair, typename = typename
|
||||
std::enable_if<!__constant_iterators
|
||||
&& std::is_convertible<_Pair,
|
||||
value_type>::value>::type>
|
||||
std::enable_if<__and_<integral_constant<bool, !__constant_iterators>,
|
||||
std::is_convertible<_Pair,
|
||||
value_type>>::value>::type>
|
||||
iterator
|
||||
insert(const_iterator, _Pair&& __v)
|
||||
{ return _Insert_Conv_Type()(insert(std::forward<_Pair>(__v))); }
|
||||
|
@ -63,7 +63,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||
typedef typename _Base::hasher hasher;
|
||||
typedef typename _Base::key_equal key_equal;
|
||||
typedef typename _Base::allocator_type allocator_type;
|
||||
|
||||
typedef typename _Base::iterator iterator;
|
||||
typedef typename _Base::const_iterator const_iterator;
|
||||
|
||||
explicit
|
||||
__unordered_set(size_type __n = 10,
|
||||
const hasher& __hf = hasher(),
|
||||
@ -103,6 +105,16 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||
this->insert(__l.begin(), __l.end());
|
||||
return *this;
|
||||
}
|
||||
|
||||
using _Base::insert;
|
||||
|
||||
std::pair<iterator, bool>
|
||||
insert(value_type&& __v)
|
||||
{ return this->_M_insert(std::move(__v), std::true_type()); }
|
||||
|
||||
iterator
|
||||
insert(const_iterator, value_type&& __v)
|
||||
{ return insert(std::move(__v)).first; }
|
||||
};
|
||||
|
||||
template<class _Value,
|
||||
@ -132,7 +144,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||
typedef typename _Base::hasher hasher;
|
||||
typedef typename _Base::key_equal key_equal;
|
||||
typedef typename _Base::allocator_type allocator_type;
|
||||
|
||||
typedef typename _Base::iterator iterator;
|
||||
typedef typename _Base::const_iterator const_iterator;
|
||||
|
||||
explicit
|
||||
__unordered_multiset(size_type __n = 10,
|
||||
const hasher& __hf = hasher(),
|
||||
@ -173,6 +187,16 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||
this->insert(__l.begin(), __l.end());
|
||||
return *this;
|
||||
}
|
||||
|
||||
using _Base::insert;
|
||||
|
||||
iterator
|
||||
insert(value_type&& __v)
|
||||
{ return this->_M_insert(std::move(__v), std::false_type()); }
|
||||
|
||||
iterator
|
||||
insert(const_iterator, value_type&& __v)
|
||||
{ return insert(std::move(__v)); }
|
||||
};
|
||||
|
||||
template<class _Value, class _Hash, class _Pred, class _Alloc,
|
||||
|
Loading…
x
Reference in New Issue
Block a user