node_handle& operator=(node_handle&& nh);
概要
ムーブ代入する。
要件
!alloc_、またはstd::allocator_traits<allocator_type>::propagate_on_container_move_assignment::value が true、または alloc_ == nh.alloc_ のいずれか。
効果
ptr_ != nullptrの場合、std::allocator_traits<allocator_type>::destroyを呼び出してptr_が指すcontainer_node_typeオブジェクト内のvalue_typeサブオブジェクトを破棄し、- 次に
std::allocator_traits<allocator_type>::template rebind_traits<container_node_type>::deallocateを呼び出してptr_の割り当てを解除する。
ptr_にnh.ptr_を代入する。!alloc_またはstd::allocator_traits<allocator_type>::propagate_on_container_move_assignment::valueがtrueの場合、nh.alloc_をalloc_にムーブ代入する。nh.ptr_にnullptrを代入し、nh.alloc_にnulloptを代入する。
戻り値
*this
例外
なげない。
備考
ムーブオンリーであり、コピー構築はできない。
例
出力
0
バージョン
言語
- C++17
処理系
- Clang: 7.0.0 ✅
- GCC: 7.1.0 ✅
- ICC: ??
- Visual C++: 2017 Update 5 ✅