35#pragma GCC system_header
40#ifdef __glibcxx_node_extract
46namespace std _GLIBCXX_VISIBILITY(default)
48_GLIBCXX_BEGIN_NAMESPACE_VERSION
66 template<
typename _Val,
typename _NodeAlloc>
75 get_allocator()
const noexcept
77 __glibcxx_assert(!this->empty());
81 explicit operator bool()
const noexcept {
return _M_ptr !=
nullptr; }
83 [[
nodiscard]]
bool empty()
const noexcept {
return _M_ptr ==
nullptr; }
110 else if (
__nh.empty())
115 _AllocTraits::destroy(*_M_alloc, _M_ptr->_M_valptr());
116 _AllocTraits::deallocate(*_M_alloc, _M_ptr, 1);
118 _M_alloc =
__nh._M_alloc.release();
119 _M_ptr =
__nh._M_ptr;
120 __nh._M_ptr =
nullptr;
129 __glibcxx_assert(
__ptr !=
nullptr);
140 else if (
__nh.empty())
145 swap(_M_ptr,
__nh._M_ptr);
146 _M_alloc.swap(
__nh._M_alloc);
158 _M_ptr =
__nh._M_ptr;
159 __nh._M_ptr =
nullptr;
169 _AllocTraits::destroy(
__alloc, _M_ptr->_M_valptr());
170 _AllocTraits::deallocate(
__alloc, _M_ptr, 1);
185 typename _AllocTraits::pointer _M_ptr;
207 if constexpr (_ATr::propagate_on_container_move_assignment::value)
209 else if constexpr (!_AllocTraits::is_always_equal::value)
210 __glibcxx_assert(_M_alloc ==
__alloc);
218 if constexpr (_AllocTraits::propagate_on_container_swap::value)
219 swap(_M_alloc, __other._M_alloc);
220 else if constexpr (!_AllocTraits::is_always_equal::value)
221 __glibcxx_assert(_M_alloc == __other._M_alloc);
231 _M_alloc.~_NodeAlloc();
242 friend class _Rb_tree;
245 typename _ExtractKey,
typename _Equal,
248 friend class _Hashtable;
254 template<
typename _Key,
typename _Value,
typename _NodeAlloc>
266 using mapped_type =
typename _Value::second_type;
271 __glibcxx_assert(!this->empty());
276 mapped()
const noexcept
278 __glibcxx_assert(!this->empty());
287 swap(_M_pkey,
__nh._M_pkey);
288 swap(_M_pmapped,
__nh._M_pmapped);
293 noexcept(
noexcept(__x.swap(__y)))
306 _M_pkey = _S_pointer_to(
__key);
307 _M_pmapped = _S_pointer_to(
__ptr->_M_valptr()->second);
312 _M_pmapped =
nullptr;
316 template<
typename _Tp>
324 template<
typename _Tp>
326 _S_pointer_to(_Tp&
__obj)
330 _M_key()
const noexcept {
return key(); }
334 friend class _Rb_tree;
337 typename _ExtractKey,
typename _Equal,
340 friend class _Hashtable;
344 template<
typename _Value,
typename _NodeAlloc>
356 using value_type = _Value;
359 value()
const noexcept
361 __glibcxx_assert(!this->empty());
362 return *this->_M_ptr->_M_valptr();
367 { this->_M_swap(
__nh); }
371 noexcept(
noexcept(__x.swap(__y)))
382 _M_key()
const noexcept {
return value(); }
385 typename _Compare,
typename _Alloc>
386 friend class _Rb_tree;
389 typename _ExtractKey,
typename _Equal,
392 friend class _Hashtable;
396 template<
typename _Iterator,
typename _NodeHandle>
399 _Iterator position = _Iterator();
400 bool inserted =
false;
406_GLIBCXX_END_NAMESPACE_VERSION
constexpr complex< _Tp > operator*(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x times y.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
ISO C++ entities toplevel namespace is std.
typename pointer_traits< _Ptr >::template rebind< _Tp > __ptr_rebind
Convenience alias for rebinding pointers.
Base class for node handle types of maps and sets.
Node handle type for maps.
Return type of insert(node_handle&&) on unique maps/sets.