Wraps a reference to a temporarily immutable range of objects. More...
Related Functions | |
(Note that these are not member functions.) | |
template<typename InputIterator > | |
immutable_range_wrapper< InputIterator > | make_immutable_range (InputIterator first, InputIterator last) noexcept |
Creates a wrapper over the immutable range [first, last) . More... | |
template<typename InputIterator , typename Size > | |
immutable_range_wrapper< InputIterator > | make_immutable_range_n (InputIterator first, const Size count) noexcept |
Creates a wrapper over the immutable range [first, first + n) . More... | |
Wraps a reference to a temporarily immutable range of objects.
Iterator | Container iterator type. |
The part of container that has been declared immutable may be passed by reference when communication happens in shared memory. The container or the objects in the range must not be deleted or mutated until all immutable_range_wrapper objects to the container have been deleted. This is commonly guaranteed with synchronization.
Once all the immutable_reference_wrapper objects have been destroyed, then the referenced containers and its stored objects can be mutated or deleted.