typename _ExtractKeya, typename _Equala,
typename _Hasha, typename _RangeHasha, typename _Unuseda,
typename _RehashPolicya, typename _Traitsa>
- friend struct __detail::_Insert_base;
-
- template<typename _Keya, typename _Valuea, typename _Alloca,
- typename _ExtractKeya, typename _Equala,
- typename _Hasha, typename _RangeHasha, typename _Unuseda,
- typename _RehashPolicya, typename _Traitsa,
- bool _Constant_iteratorsa>
friend struct __detail::_Insert;
template<typename _Keya, typename _Valuea, typename _Alloca,
template<typename... _Args>
std::pair<iterator, bool>
- _M_emplace(true_type __uks, _Args&&... __args);
+ _M_emplace_uniq(_Args&&... __args);
- template<typename... _Args>
- iterator
- _M_emplace(false_type __uks, _Args&&... __args)
- { return _M_emplace(cend(), __uks, std::forward<_Args>(__args)...); }
-
- // Emplace with hint, useless when keys are unique.
- template<typename... _Args>
- iterator
- _M_emplace(const_iterator, true_type __uks, _Args&&... __args)
- { return _M_emplace(__uks, std::forward<_Args>(__args)...).first; }
-
- template<typename... _Args>
- iterator
- _M_emplace(const_iterator, false_type __uks, _Args&&... __args);
-
- template<typename _Kt, typename _Arg, typename _NodeGenerator>
- std::pair<iterator, bool>
- _M_insert_unique(_Kt&&, _Arg&&, _NodeGenerator&);
-
- template<typename _Arg, typename _NodeGenerator>
- std::pair<iterator, bool>
- _M_insert_unique_aux(_Arg&& __arg, _NodeGenerator& __node_gen)
- {
- using _Kt = decltype(_ExtractKey{}(std::forward<_Arg>(__arg)));
- constexpr bool __is_key_type
- = is_same<__remove_cvref_t<_Kt>, key_type>::value;
- using _Fwd_key = __conditional_t<__is_key_type, _Kt&&, key_type>;
- return _M_insert_unique(
- static_cast<_Fwd_key>(_ExtractKey{}(std::forward<_Arg>(__arg))),
- std::forward<_Arg>(__arg), __node_gen);
- }
-
- template<typename _Arg, typename _NodeGenerator>
- std::pair<iterator, bool>
- _M_insert(_Arg&& __arg, _NodeGenerator& __node_gen,
- true_type /* __uks */)
- {
- using __detail::_Identity;
- using _Vt = __conditional_t<is_same<_ExtractKey, _Identity>::value
- || __is_pair<__remove_cvref_t<_Arg>>,
- _Arg&&, value_type>;
- return _M_insert_unique_aux(
- static_cast<_Vt>(std::forward<_Arg>(__arg)), __node_gen);
- }
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wc++14-extensions" // variable templates
+ template<typename _Arg, typename _DArg = __remove_cvref_t<_Arg>,
+ typename = _ExtractKey>
+ static constexpr bool __is_key_type = false;
- template<typename _Arg, typename _NodeGenerator>
- iterator
- _M_insert(_Arg&& __arg, _NodeGenerator& __node_gen,
- false_type __uks)
- {
- return _M_insert(cend(), std::forward<_Arg>(__arg),
- __node_gen, __uks);
- }
+ template<typename _Arg>
+ static constexpr bool
+ __is_key_type<_Arg, key_type, __detail::_Identity> = true;
- // Insert with hint, not used when keys are unique.
- template<typename _Arg, typename _NodeGenerator>
- iterator
- _M_insert(const_iterator, _Arg&& __arg,
- _NodeGenerator& __node_gen, true_type __uks)
- {
- return
- _M_insert(std::forward<_Arg>(__arg), __node_gen, __uks).first;
- }
+ template<typename _Arg, typename _Arg1, typename _Arg2>
+ static constexpr bool
+ __is_key_type<_Arg, pair<_Arg1, _Arg2>, __detail::_Select1st>
+ = is_same<__remove_cvref_t<_Arg1>, key_type>::value;
+#pragma GCC diagnostic pop
- // Insert with hint when keys are not unique.
- template<typename _Arg, typename _NodeGenerator>
+ template<typename... _Args>
iterator
- _M_insert(const_iterator, _Arg&&,
- _NodeGenerator&, false_type __uks);
+ _M_emplace_multi(const_iterator, _Args&&... __args);
size_type
_M_erase(true_type __uks, const key_type&);
_M_erase(size_type __bkt, __node_base_ptr __prev_n, __node_ptr __n);
public:
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wc++17-extensions" // if constexpr
// Emplace
template<typename... _Args>
__ireturn_type
emplace(_Args&&... __args)
- { return _M_emplace(__unique_keys{}, std::forward<_Args>(__args)...); }
+ {
+ if constexpr (__unique_keys::value)
+ return _M_emplace_uniq(std::forward<_Args>(__args)...);
+ else
+ return _M_emplace_multi(cend(), std::forward<_Args>(__args)...);
+ }
template<typename... _Args>
iterator
emplace_hint(const_iterator __hint, _Args&&... __args)
{
- return _M_emplace(__hint, __unique_keys{},
- std::forward<_Args>(__args)...);
+ if constexpr (__unique_keys::value)
+ return _M_emplace_uniq(std::forward<_Args>(__args)...).first;
+ else
+ return _M_emplace_multi(__hint, std::forward<_Args>(__args)...);
}
+#pragma GCC diagnostic pop
// Insert member functions via inheritance.
_M_bucket_count = __bkt_count;
}
- __alloc_node_gen_t __node_gen(*this);
for (; __f != __l; ++__f)
- _M_insert(*__f, __node_gen, __uks);
+ _M_emplace_multi(cend(), *__f);
}
template<typename _Key, typename _Value, typename _Alloc,
return __prev_n;
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wc++17-extensions" // if constexpr
template<typename _Key, typename _Value, typename _Alloc,
typename _ExtractKey, typename _Equal,
typename _Hash, typename _RangeHash, typename _Unused,
auto
_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
_Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::
- _M_emplace(true_type /* __uks */, _Args&&... __args)
+ _M_emplace_uniq(_Args&&... __args)
-> pair<iterator, bool>
{
- // First build the node to get access to the hash code
- _Scoped_node __node { this, std::forward<_Args>(__args)... };
- const key_type& __k = _ExtractKey{}(__node._M_node->_M_v());
+ const key_type* __kp = nullptr;
+
+ if constexpr (sizeof...(_Args) == 1)
+ {
+ if constexpr (__is_key_type<_Args...>)
+ {
+ const auto& __key = _ExtractKey{}(__args...);
+ __kp = std::__addressof(__key);
+ }
+ }
+ else if constexpr (sizeof...(_Args) == 2)
+ {
+ pair<const _Args&...> __refs(__args...);
+ if constexpr (__is_key_type<pair<_Args...>>)
+ {
+ const auto& __key = _ExtractKey{}(__refs);
+ __kp = std::__addressof(__key);
+ }
+ }
+
+ _Scoped_node __node { __node_ptr(), this }; // Do not create node yet.
+ __hash_code __code = 0;
+ size_type __bkt = 0;
+
+ if (__kp == nullptr)
+ {
+ // Didn't extract a key from the args, so build the node.
+ __node._M_node
+ = this->_M_allocate_node(std::forward<_Args>(__args)...);
+ const key_type& __key = _ExtractKey{}(__node._M_node->_M_v());
+ __kp = std::__addressof(__key);
+ }
+
const size_type __size = size();
if (__size <= __small_size_threshold())
{
for (auto __it = _M_begin(); __it; __it = __it->_M_next())
- if (this->_M_key_equals(__k, *__it))
- // There is already an equivalent node, no insertion
+ if (this->_M_key_equals(*__kp, *__it))
+ // There is already an equivalent node, no insertion.
return { iterator(__it), false };
}
- __hash_code __code = this->_M_hash_code(__k);
- size_type __bkt = _M_bucket_index(__code);
+ __code = this->_M_hash_code(*__kp);
+ __bkt = _M_bucket_index(__code);
+
if (__size > __small_size_threshold())
- if (__node_ptr __p = _M_find_node(__bkt, __k, __code))
- // There is already an equivalent node, no insertion
+ if (__node_ptr __p = _M_find_node(__bkt, *__kp, __code))
+ // There is already an equivalent node, no insertion.
return { iterator(__p), false };
+ if (!__node._M_node)
+ __node._M_node
+ = this->_M_allocate_node(std::forward<_Args>(__args)...);
+
// Insert the node
auto __pos = _M_insert_unique_node(__bkt, __code, __node._M_node);
__node._M_node = nullptr;
return { __pos, true };
}
+#pragma GCC diagnostic pop
template<typename _Key, typename _Value, typename _Alloc,
typename _ExtractKey, typename _Equal,
auto
_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
_Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::
- _M_emplace(const_iterator __hint, false_type /* __uks */,
- _Args&&... __args)
+ _M_emplace_multi(const_iterator __hint, _Args&&... __args)
-> iterator
{
// First build the node to get its hash code.
- _Scoped_node __node { this, std::forward<_Args>(__args)... };
+ _Scoped_node __node { this, std::forward<_Args>(__args)... };
const key_type& __k = _ExtractKey{}(__node._M_node->_M_v());
auto __res = this->_M_compute_hash_code(__hint._M_cur, __k);
return iterator(__node);
}
- // Insert v if no element with its key is already present.
- template<typename _Key, typename _Value, typename _Alloc,
- typename _ExtractKey, typename _Equal,
- typename _Hash, typename _RangeHash, typename _Unused,
- typename _RehashPolicy, typename _Traits>
- template<typename _Kt, typename _Arg, typename _NodeGenerator>
- auto
- _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
- _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::
- _M_insert_unique(_Kt&& __k, _Arg&& __v,
- _NodeGenerator& __node_gen)
- -> pair<iterator, bool>
- {
- const size_type __size = size();
- if (__size <= __small_size_threshold())
- for (auto __it = _M_begin(); __it; __it = __it->_M_next())
- if (this->_M_key_equals_tr(__k, *__it))
- return { iterator(__it), false };
-
- __hash_code __code = this->_M_hash_code_tr(__k);
- size_type __bkt = _M_bucket_index(__code);
-
- if (__size > __small_size_threshold())
- if (__node_ptr __node = _M_find_node_tr(__bkt, __k, __code))
- return { iterator(__node), false };
-
- _Scoped_node __node {
- __node_builder_t::_S_build(std::forward<_Kt>(__k),
- std::forward<_Arg>(__v),
- __node_gen),
- this
- };
- auto __pos
- = _M_insert_unique_node(__bkt, __code, __node._M_node);
- __node._M_node = nullptr;
- return { __pos, true };
- }
-
- // Insert v unconditionally.
- template<typename _Key, typename _Value, typename _Alloc,
- typename _ExtractKey, typename _Equal,
- typename _Hash, typename _RangeHash, typename _Unused,
- typename _RehashPolicy, typename _Traits>
- template<typename _Arg, typename _NodeGenerator>
- auto
- _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
- _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::
- _M_insert(const_iterator __hint, _Arg&& __v,
- _NodeGenerator& __node_gen,
- false_type /* __uks */)
- -> iterator
- {
- // First allocate new node so that we don't do anything if it throws.
- _Scoped_node __node{ __node_gen(std::forward<_Arg>(__v)), this };
-
- // Second compute the hash code so that we don't rehash if it throws.
- auto __res = this->_M_compute_hash_code(
- __hint._M_cur, _ExtractKey{}(__node._M_node->_M_v()));
-
- auto __pos
- = _M_insert_multi_node(__res.first, __res.second, __node._M_node);
- __node._M_node = nullptr;
- return __pos;
- }
-
template<typename _Key, typename _Value, typename _Alloc,
typename _ExtractKey, typename _Equal,
typename _Hash, typename _RangeHash, typename _Unused,
_RangeHash, _Unused, _RehashPolicy, _Traits, __uniq>
{ };
- /**
- * Primary class template _Insert_base.
- *
- * Defines @c insert member functions appropriate to all _Hashtables.
- */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wc++17-extensions" // if constexpr
+
+ // Defines `insert` member functions for _Hashtables.
template<typename _Key, typename _Value, typename _Alloc,
typename _ExtractKey, typename _Equal,
typename _Hash, typename _RangeHash, typename _Unused,
typename _RehashPolicy, typename _Traits>
- struct _Insert_base
+ struct _Insert
{
protected:
using __hashtable_base = _Hashtable_base<_Key, _Value, _ExtractKey,
using __node_alloc_type = typename __hashtable_alloc::__node_alloc_type;
using __node_gen_type = _AllocNode<__node_alloc_type>;
+ [[__gnu__::__always_inline__]]
__hashtable&
_M_conjure_hashtable()
{ return *(static_cast<__hashtable*>(this)); }
- template<typename _InputIterator, typename _NodeGetter>
- void
- _M_insert_range(_InputIterator __first, _InputIterator __last,
- _NodeGetter&, true_type __uks);
-
- template<typename _InputIterator, typename _NodeGetter>
+ template<typename _InputIterator>
void
- _M_insert_range(_InputIterator __first, _InputIterator __last,
- _NodeGetter&, false_type __uks);
+ _M_insert_range_multi(_InputIterator __first, _InputIterator __last);
public:
using iterator = _Node_iterator<_Value, __constant_iterators::value,
insert(const value_type& __v)
{
__hashtable& __h = _M_conjure_hashtable();
- __node_gen_type __node_gen(__h);
- return __h._M_insert(__v, __node_gen, __unique_keys{});
+ if constexpr (__unique_keys::value)
+ return __h._M_emplace_uniq(__v);
+ else
+ return __h._M_emplace_multi(__h.cend(), __v);
}
iterator
insert(const_iterator __hint, const value_type& __v)
{
__hashtable& __h = _M_conjure_hashtable();
- __node_gen_type __node_gen(__h);
- return __h._M_insert(__hint, __v, __node_gen, __unique_keys{});
+ if constexpr (__unique_keys::value)
+ return __h._M_emplace_uniq(__v).first;
+ else
+ return __h._M_emplace_multi(__hint, __v);
+ }
+
+ __ireturn_type
+ insert(value_type&& __v)
+ {
+ __hashtable& __h = _M_conjure_hashtable();
+ if constexpr (__unique_keys::value)
+ return __h._M_emplace_uniq(std::move(__v));
+ else
+ return __h._M_emplace_multi(__h.cend(), std::move(__v));
+ }
+
+ iterator
+ insert(const_iterator __hint, value_type&& __v)
+ {
+ __hashtable& __h = _M_conjure_hashtable();
+ if constexpr (__unique_keys::value)
+ return __h._M_emplace_uniq(std::move(__v)).first;
+ else
+ return __h._M_emplace_multi(__hint, std::move(__v));
}
#ifdef __glibcxx_unordered_map_try_emplace // C++ >= 17 && HOSTED
insert(_InputIterator __first, _InputIterator __last)
{
__hashtable& __h = _M_conjure_hashtable();
- __node_gen_type __node_gen(__h);
- return _M_insert_range(__first, __last, __node_gen, __unique_keys{});
+ if constexpr (__unique_keys::value)
+ for (; __first != __last; ++__first)
+ __h._M_emplace_uniq(*__first);
+ else
+ return _M_insert_range_multi(__first, __last);
}
- };
- template<typename _Key, typename _Value, typename _Alloc,
- typename _ExtractKey, typename _Equal,
- typename _Hash, typename _RangeHash, typename _Unused,
- typename _RehashPolicy, typename _Traits>
- template<typename _InputIterator, typename _NodeGetter>
- void
- _Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal,
- _Hash, _RangeHash, _Unused,
- _RehashPolicy, _Traits>::
- _M_insert_range(_InputIterator __first, _InputIterator __last,
- _NodeGetter& __node_gen, true_type __uks)
- {
- __hashtable& __h = _M_conjure_hashtable();
- for (; __first != __last; ++__first)
- __h._M_insert(*__first, __node_gen, __uks);
- }
+ // This overload is only defined for maps, not sets.
+ template<typename _Pair,
+ typename = _Require<__not_<is_same<_Key, _Value>>,
+ is_constructible<value_type, _Pair&&>>>
+ __ireturn_type
+ insert(_Pair&& __v)
+ {
+ __hashtable& __h = this->_M_conjure_hashtable();
+ if constexpr (__unique_keys::value)
+ return __h._M_emplace_uniq(std::forward<_Pair>(__v));
+ else
+ return __h._M_emplace_multi(__h.cend(), std::forward<_Pair>(__v));
+ }
+
+ // This overload is only defined for maps, not sets.
+ template<typename _Pair,
+ typename = _Require<__not_<is_same<_Key, _Value>>,
+ is_constructible<value_type, _Pair&&>>>
+ iterator
+ insert(const_iterator __hint, _Pair&& __v)
+ {
+ __hashtable& __h = this->_M_conjure_hashtable();
+ if constexpr (__unique_keys::value)
+ return __h._M_emplace_uniq(std::forward<_Pair>(__v));
+ else
+ return __h._M_emplace_multi(__hint, std::forward<_Pair>(__v));
+ }
+ };
+#pragma GCC diagnostic pop
template<typename _Key, typename _Value, typename _Alloc,
typename _ExtractKey, typename _Equal,
typename _Hash, typename _RangeHash, typename _Unused,
typename _RehashPolicy, typename _Traits>
- template<typename _InputIterator, typename _NodeGetter>
+ template<typename _InputIterator>
void
- _Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal,
- _Hash, _RangeHash, _Unused,
- _RehashPolicy, _Traits>::
- _M_insert_range(_InputIterator __first, _InputIterator __last,
- _NodeGetter& __node_gen, false_type __uks)
+ _Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash,
+ _Unused, _RehashPolicy, _Traits>::
+ _M_insert_range_multi(_InputIterator __first, _InputIterator __last)
{
using __rehash_guard_t = typename __hashtable::__rehash_guard_t;
using __pair_type = std::pair<bool, std::size_t>;
__n_elt);
if (__do_rehash.first)
- __h._M_rehash(__do_rehash.second, __uks);
+ __h._M_rehash(__do_rehash.second, false_type{});
__rehash_guard._M_guarded_obj = nullptr;
for (; __first != __last; ++__first)
- __h._M_insert(*__first, __node_gen, __uks);
+ __h._M_emplace_multi(__h.cend(), *__first);
}
- /**
- * Primary class template _Insert.
- *
- * Defines @c insert member functions that depend on _Hashtable policies,
- * via partial specializations.
- */
- template<typename _Key, typename _Value, typename _Alloc,
- typename _ExtractKey, typename _Equal,
- typename _Hash, typename _RangeHash, typename _Unused,
- typename _RehashPolicy, typename _Traits,
- bool _Constant_iterators = _Traits::__constant_iterators::value>
- struct _Insert;
-
- /// Specialization.
- template<typename _Key, typename _Value, typename _Alloc,
- typename _ExtractKey, typename _Equal,
- typename _Hash, typename _RangeHash, typename _Unused,
- typename _RehashPolicy, typename _Traits>
- struct _Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal,
- _Hash, _RangeHash, _Unused,
- _RehashPolicy, _Traits, true>
- : public _Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal,
- _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>
- {
- using __base_type = _Insert_base<_Key, _Value, _Alloc, _ExtractKey,
- _Equal, _Hash, _RangeHash, _Unused,
- _RehashPolicy, _Traits>;
-
- using value_type = typename __base_type::value_type;
- using iterator = typename __base_type::iterator;
- using const_iterator = typename __base_type::const_iterator;
- using __ireturn_type = typename __base_type::__ireturn_type;
-
- using __unique_keys = typename __base_type::__unique_keys;
- using __hashtable = typename __base_type::__hashtable;
- using __node_gen_type = typename __base_type::__node_gen_type;
-
- using __base_type::insert;
-
- __ireturn_type
- insert(value_type&& __v)
- {
- __hashtable& __h = this->_M_conjure_hashtable();
- __node_gen_type __node_gen(__h);
- return __h._M_insert(std::move(__v), __node_gen, __unique_keys{});
- }
-
- iterator
- insert(const_iterator __hint, value_type&& __v)
- {
- __hashtable& __h = this->_M_conjure_hashtable();
- __node_gen_type __node_gen(__h);
- return __h._M_insert(__hint, std::move(__v), __node_gen,
- __unique_keys{});
- }
- };
-
- /// Specialization.
- template<typename _Key, typename _Value, typename _Alloc,
- typename _ExtractKey, typename _Equal,
- typename _Hash, typename _RangeHash, typename _Unused,
- typename _RehashPolicy, typename _Traits>
- struct _Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal,
- _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits, false>
- : public _Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal,
- _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>
- {
- using __base_type = _Insert_base<_Key, _Value, _Alloc, _ExtractKey,
- _Equal, _Hash, _RangeHash, _Unused,
- _RehashPolicy, _Traits>;
- using value_type = typename __base_type::value_type;
- using iterator = typename __base_type::iterator;
- using const_iterator = typename __base_type::const_iterator;
-
- using __unique_keys = typename __base_type::__unique_keys;
- using __hashtable = typename __base_type::__hashtable;
- using __ireturn_type = typename __base_type::__ireturn_type;
-
- using __base_type::insert;
-
- template<typename _Pair>
- using __is_cons = std::is_constructible<value_type, _Pair&&>;
-
- template<typename _Pair>
- using _IFcons = std::enable_if<__is_cons<_Pair>::value>;
-
- template<typename _Pair>
- using _IFconsp = typename _IFcons<_Pair>::type;
-
- template<typename _Pair, typename = _IFconsp<_Pair>>
- __ireturn_type
- insert(_Pair&& __v)
- {
- __hashtable& __h = this->_M_conjure_hashtable();
- return __h._M_emplace(__unique_keys{}, std::forward<_Pair>(__v));
- }
-
- template<typename _Pair, typename = _IFconsp<_Pair>>
- iterator
- insert(const_iterator __hint, _Pair&& __v)
- {
- __hashtable& __h = this->_M_conjure_hashtable();
- return __h._M_emplace(__hint, __unique_keys{},
- std::forward<_Pair>(__v));
- }
- };
-
template<typename _Policy>
using __has_load_factor = typename _Policy::__has_load_factor;
VERIFY( um.size() == 1 );
VERIFY( __gnu_test::counter::count() == 4 );
- VERIFY( __gnu_test::counter::get()._M_increments == 5 );
+ // Allocated another node and a pair<const std::string, std::string>:
+ VERIFY( __gnu_test::counter::get()._M_increments == 7 );
}
void
VERIFY( um.size() == 1 );
VERIFY( __gnu_test::counter::count() == 4 );
- VERIFY( __gnu_test::counter::get()._M_increments == 5 );
+ // Allocated another node and a pair<const std::string, std::string>:
+ VERIFY( __gnu_test::counter::get()._M_increments == 7 );
}
std::size_t
VERIFY( um.size() == 1 );
VERIFY( __gnu_test::counter::count() == 4 );
- VERIFY( __gnu_test::counter::get()._M_increments == 5 );
+ // Allocated another node and a pair<const std::string, std::string>:
+ VERIFY( __gnu_test::counter::get()._M_increments == 7 );
}
std::size_t
VERIFY( um.size() == 1 );
VERIFY( __gnu_test::counter::count() == 4 );
- VERIFY( __gnu_test::counter::get()._M_increments == 5 );
+ // Allocated another node and a pair<const std::string, std::string>:
+ VERIFY( __gnu_test::counter::get()._M_increments == 7 );
}
struct hash_string_functor
VERIFY( um.size() == 1 );
VERIFY( __gnu_test::counter::count() == 4 );
- VERIFY( __gnu_test::counter::get()._M_increments == 5 );
+ // Allocated another node and a pair<const std::string, std::string>:
+ VERIFY( __gnu_test::counter::get()._M_increments == 7 );
}
struct hash_string_view_noexcept_functor
VERIFY( um.size() == 1 );
VERIFY( __gnu_test::counter::count() == 4 );
- VERIFY( __gnu_test::counter::get()._M_increments == 5 );
+ // Allocated another node and a pair<const std::string, std::string>:
+ VERIFY( __gnu_test::counter::get()._M_increments == 7 );
}
struct hash_string_view_functor
VERIFY( um.size() == 1 );
VERIFY( __gnu_test::counter::count() == 4 );
- VERIFY( __gnu_test::counter::get()._M_increments == 5 );
+ // Allocated another node and a pair<const std::string, std::string>:
+ VERIFY( __gnu_test::counter::get()._M_increments == 7 );
}
void
VERIFY( us.size() == 1 );
VERIFY( __gnu_test::counter::count() == 3 );
- VERIFY( __gnu_test::counter::get()._M_increments == 4 );
+ VERIFY( __gnu_test::counter::get()._M_increments == 5 );
}
void
VERIFY( us.size() == 1 );
VERIFY( __gnu_test::counter::count() == 3 );
- VERIFY( __gnu_test::counter::get()._M_increments == 4 );
+ VERIFY( __gnu_test::counter::get()._M_increments == 5 );
}
std::size_t
VERIFY( us.size() == 1 );
VERIFY( __gnu_test::counter::count() == 3 );
- VERIFY( __gnu_test::counter::get()._M_increments == 4 );
+ VERIFY( __gnu_test::counter::get()._M_increments == 5 );
}
std::size_t
VERIFY( us.size() == 1 );
VERIFY( __gnu_test::counter::count() == 3 );
- VERIFY( __gnu_test::counter::get()._M_increments == 4 );
+ VERIFY( __gnu_test::counter::get()._M_increments == 5 );
}
struct hash_string_functor
VERIFY( us.size() == 1 );
VERIFY( __gnu_test::counter::count() == 3 );
- VERIFY( __gnu_test::counter::get()._M_increments == 4 );
+ VERIFY( __gnu_test::counter::get()._M_increments == 5 );
}
struct hash_string_view_noexcept_functor
VERIFY( us.size() == 1 );
VERIFY( __gnu_test::counter::count() == 3 );
- VERIFY( __gnu_test::counter::get()._M_increments == 4 );
+ VERIFY( __gnu_test::counter::get()._M_increments == 5 );
}
struct hash_string_view_functor
VERIFY( us.size() == 1 );
VERIFY( __gnu_test::counter::count() == 3 );
- VERIFY( __gnu_test::counter::get()._M_increments == 4 );
+ VERIFY( __gnu_test::counter::get()._M_increments == 5 );
}
void