libstdc++
GNU C++ library
Loading...
Searching...
No Matches

◆ operator=() [2/2]

template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc>
_Rb_tree< _Key, _Val, _KeyOfValue, _Compare, _Alloc > & std::_Rb_tree< _Key, _Val, _KeyOfValue, _Compare, _Alloc >::operator= ( const _Rb_tree< _Key, _Val, _KeyOfValue, _Compare, _Alloc > & __x)

Definition at line 2468 of file stl_tree.h.

2470 {
2471 if (this != std::__addressof(__x))
2472 {
2473 // Note that _Key may be a constant type.
2474#if __cplusplus >= 201103L
2476 {
2477 auto& __this_alloc = this->_M_get_Node_allocator();
2481 {
2482 // Replacement allocator cannot free existing storage, we need
2483 // to erase nodes first.
2484 clear();
2486 }
2487 }
2488#endif
2489
2491 _M_impl._M_reset();
2492 _M_impl._M_key_compare = __x._M_impl._M_key_compare;
2493 if (__x._M_root())
2495 }
2496
2497 return *this;
2498 }
_Key_compare _M_key_compare
Definition stl_tree.h:142
_Rb_tree_impl< _Compare > _M_impl
Definition stl_tree.h:1349
_Base_ptr _M_copy(_Node_ptr, _Base_ptr, _NodeGen &)
Definition stl_tree.h:2584
_Node_allocator & _M_get_Node_allocator() noexcept
Definition stl_tree.h:1154
_Base_ptr & _M_root() noexcept
Definition stl_tree.h:1353
void clear() noexcept
Definition stl_tree.h:1902

References _Rb_tree(), std::__addressof(), _M_copy(), _M_get_Node_allocator(), _M_impl, std::_Rb_tree_key_compare< _Key_compare >::_M_key_compare, _M_root(), __gnu_cxx::__alloc_traits< _Node_allocator >::_S_always_equal(), __gnu_cxx::__alloc_traits< _Node_allocator >::_S_propagate_on_copy_assign(), and clear().

Here is the call graph for this function: