Wraps a reference to a temporarily immutable object. More...
Public Member Functions | |
| immutable_reference_wrapper (T const &t) noexcept | |
| immutable_reference_wrapper (T &&)=delete | |
| immutable_reference_wrapper (immutable_reference_wrapper const &) noexcept=default | |
| immutable_reference_wrapper (immutable_reference_wrapper &&) noexcept=default | |
| operator T const & (void) const noexcept | |
| T const & | get (void) const noexcept |
Public Types | |
| using | type = T |
Related Functions | |
(Note that these are not member functions.) | |
| template<typename T > | |
| immutable_reference_wrapper< T > | immutable_ref (T const &t) |
Creates an immutable reference to t. More... | |
Wraps a reference to a temporarily immutable object.
| T | Object type. |
Referents of immutable references may avoid serialization when communication happens in shared memory. The referent must not be deleted or mutated until all immutable_reference_wrapper to it have been deleted. This is commonly guaranteed with synchronization.
Once all the immutable_reference_wrapper objects have been destroyed, then the referenced object can be mutated or deleted.
1.8.13