auto write() -> element_type&
(1)

Obtain a reference to the value the object is referencing.

  1. Nonconst accessor

Return value

A reference to the underlying object

Obtain a reference to the value the object is referencing. This will copy the underlying value (if necessary) so changes to the value do not affect other copy_on_write objects.

Note that write() does not have the same preconditions as operator=(). write() returns a reference to the underlying object’s value, thus requiring that an underlying object exist. operator=() on the other hand will perform an allocation if one is necessary.