bsl::list::operator=

Assignment operators

Synopses

Declared in <bslstl_list.h>

Assign to this object the value of the specified rhs object, propagate to this object the allocator of rhs if the ALLOCATOR type has trait propagate_on_container_copy_assignment, and return a reference providing modifiable access to this object. If an exception is thrown, *this is left in a valid but unspecified state. This method requires that the (template parameter) type VALUE be copy-assignable and copy-insertable into this list. Note that, to the extent possible, existing elements of this list are copy-assigned to, to minimize the number of nodes that need to be copy-inserted or erased.

list<VALUE, ALLOCATOR>&
operator=(list const& rhs);
» more...

Assign to this object the value of the specified rhs object, propagate to this object the allocator of rhs if the ALLOCATOR type has trait propagate_on_container_move_assignment, and return a reference providing modifiable access to this object. The contents of rhs are moved (in constant time) to this list if get_allocator() == rhs.get_allocator() (after accounting for the aforementioned trait); otherwise, all elements in this list are either destroyed or move-assigned to and each additional element in rhs is move-inserted into this list. rhs is left in a valid but unspecified state, and if an exception is thrown, *this is left in a valid but unspecified state. This method requires that the (template parameter) type VALUE be move-assignable and move-insertable into this list (see {Requirements on VALUE}).

list<VALUE, ALLOCATOR>&
operator=(BloombergLP::bslmf::MovableRef<list> rhs) noexcept(AllocTraits::is_always_equal::value);
» more...

Assign to this list, in order, the sequence of values in the specified rhs initializer list, and return a reference providing modifiable access to this list. This method requires that the (template parameter) type VALUE be copy-assignable and copy-insertable into this list. Note that, to the extent possible, existing elements of this list are copy-assigned to, to minimize the number of nodes that need to be copy-inserted or erased.

list<VALUE, ALLOCATOR>&
operator=(std::initializer_list<value_type> rhs);
» more...