_M_insert_multi_node(__node_type* __hint,
__hash_code __code, __node_type* __n);
- template<typename... _Args>
- std::pair<iterator, bool>
- _M_emplace(std::true_type, _Args&&... __args);
+ template<bool _Uniq, typename... _Args>
+ typename enable_if<_Uniq, std::pair<iterator, bool>>::type
+ _M_emplace(__bool_constant<_Uniq>, _Args&&... __args);
- template<typename... _Args>
- iterator
- _M_emplace(std::false_type __uk, _Args&&... __args)
- { return _M_emplace(cend(), __uk, std::forward<_Args>(__args)...); }
+ template<bool _Uniq, typename... _Args>
+ typename enable_if<!_Uniq, iterator>::type
+ _M_emplace(__bool_constant<_Uniq> __uk, _Args&&... __args)
+ {
+ return _M_emplace_hint(cend(), __uk, std::forward<_Args>(__args)...);
+ }
// Emplace with hint, useless when keys are unique.
template<typename... _Args>
iterator
- _M_emplace(const_iterator, std::true_type __uk, _Args&&... __args)
+ _M_emplace_hint(const_iterator, std::true_type __uk, _Args&&... __args)
{ return _M_emplace(__uk, std::forward<_Args>(__args)...).first; }
template<typename... _Args>
iterator
- _M_emplace(const_iterator, std::false_type, _Args&&... __args);
+ _M_emplace_hint(const_iterator, std::false_type, _Args&&... __args);
template<typename _Arg, typename _NodeGenerator>
std::pair<iterator, bool>
const _NodeGenerator&, std::false_type);
size_type
- _M_erase(std::true_type, const key_type&);
+ _M_erase(const key_type&, std::true_type);
size_type
- _M_erase(std::false_type, const key_type&);
+ _M_erase(const key_type&, std::false_type);
iterator
_M_erase(size_type __bkt, __node_base* __prev_n, __node_type* __n);
iterator
emplace_hint(const_iterator __hint, _Args&&... __args)
{
- return _M_emplace(__hint, __unique_keys(),
- std::forward<_Args>(__args)...);
+ return _M_emplace_hint(__hint, __unique_keys(),
+ std::forward<_Args>(__args)...);
}
// Insert member functions via inheritance.
size_type
erase(const key_type& __k)
- { return _M_erase(__unique_keys(), __k); }
+ { return _M_erase(__k, __unique_keys()); }
iterator
erase(const_iterator, const_iterator);
typename _Alloc, typename _ExtractKey, typename _Equal,
typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
typename _Traits>
- template<typename... _Args>
+ template<bool _Uniq, typename... _Args>
auto
_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
_H1, _H2, _Hash, _RehashPolicy, _Traits>::
- _M_emplace(std::true_type, _Args&&... __args)
- -> pair<iterator, bool>
+ _M_emplace(__bool_constant<_Uniq>, _Args&&... __args)
+ -> typename enable_if<_Uniq, pair<iterator, bool>>::type
{
// First build the node to get access to the hash code
__node_type* __node = this->_M_allocate_node(std::forward<_Args>(__args)...);
auto
_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
_H1, _H2, _Hash, _RehashPolicy, _Traits>::
- _M_emplace(const_iterator __hint, std::false_type, _Args&&... __args)
+ _M_emplace_hint(const_iterator __hint, std::false_type, _Args&&... __args)
-> iterator
{
// First build the node to get its hash code.
auto
_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
_H1, _H2, _Hash, _RehashPolicy, _Traits>::
- _M_erase(std::true_type, const key_type& __k)
+ _M_erase(const key_type& __k, std::true_type)
-> size_type
{
__hash_code __code = this->_M_hash_code(__k);
auto
_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
_H1, _H2, _Hash, _RehashPolicy, _Traits>::
- _M_erase(std::false_type, const key_type& __k)
+ _M_erase(const key_type& __k, std::false_type)
-> size_type
{
__hash_code __code = this->_M_hash_code(__k);