MapLibre Native Core
|
#include <immutable.hpp>
Public Member Functions | |
template<class S > | |
Immutable (Mutable< S > &&s) | |
template<class S > | |
Immutable (Immutable< S > s) | |
Immutable (Immutable &&) noexcept=default | |
Immutable (const Immutable &)=default | |
template<class S > | |
Immutable & | operator= (Mutable< S > &&s) |
Immutable & | operator= (Immutable &&) noexcept=default |
Immutable & | operator= (const Immutable &)=default |
const T * | get () const |
const T * | operator-> () const |
const T & | operator* () const |
Friends | |
template<class S > | |
class | Immutable |
bool | operator== (const Immutable< T > &lhs, const Immutable< T > &rhs) |
bool | operator!= (const Immutable< T > &lhs, const Immutable< T > &rhs) |
template<class S , class U > | |
Immutable< S > | staticImmutableCast (const Immutable< U > &) |
Immutable<T>
is a non-nullable shared reference to a const T
. Construction requires a transfer of unique ownership from a Mutable<T>
; once constructed it has the same behavior as std::shared_ptr<const T>
but with better indication of intent.
Normally one should not share state between threads because it's difficult to verify the absence of read/write data races. Immutable
provides a guarantee that no writes are possible, and instances therefore can be freely transferred and shared between threads.
Definition at line 67 of file immutable.hpp.
Definition at line 70 of file immutable.hpp.
Definition at line 74 of file immutable.hpp.
|
defaultnoexcept |
|
default |
|
inline |
Definition at line 89 of file immutable.hpp.
|
inline |
Definition at line 91 of file immutable.hpp.
|
inline |
Definition at line 90 of file immutable.hpp.
|
default |
|
defaultnoexcept |
|
inline |
Definition at line 81 of file immutable.hpp.
Definition at line 107 of file immutable.hpp.
|
friend |
Definition at line 97 of file immutable.hpp.
|
friend |
Definition at line 93 of file immutable.hpp.
|
friend |
Definition at line 114 of file immutable.hpp.