auto operator=(const copy_on_write& x) noexcept -> copy_on_write&
(1)
auto operator=(copy_on_write&& x) noexcept -> copy_on_write&
(2)
template <class U>
auto operator=(U&& x) -> disable_copy_assign<U>
(3)

Assigns a copy_on_write

  1. Copy assignment.

  2. Move assignment.

  3. Forwarded element_type assignment

As with copy construction, assignment is a non-throwing operation which releases the old value and increments the reference count of the item being assigned to.

Return value

*this