STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types | Related Functions
stapl::immutable_reference_wrapper< T, bool > Class Template Reference

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...
 

Detailed Description

template<typename T, bool = (sizeof(T)<=sizeof(T*) && is_basic<T>::value)>
class stapl::immutable_reference_wrapper< T, bool >

Wraps a reference to a temporarily immutable object.

Template Parameters
TObject 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.

See also
immutable_shared

The documentation for this class was generated from the following file: