MapLibre Native Core
|
#include <immutable.hpp>
Public Member Functions | |
Mutable (Mutable &&) noexcept=default | |
Mutable & | operator= (Mutable &&) noexcept=default |
Mutable (const Mutable &)=delete | |
Mutable & | operator= (const Mutable &)=delete |
T * | get () |
T * | operator-> () |
T & | operator* () |
Friends | |
template<class S > | |
class | Immutable |
template<class S , class... Args> | |
Mutable< S > | makeMutable (Args &&...) |
template<class S , class U > | |
Mutable< S > | staticMutableCast (const Mutable< U > &) |
Mutable<T>
is a non-nullable uniquely owning reference to a T
. It can be efficiently converted to Immutable<T>
.
The lifecycle of Mutable<T>
and Immutable<T>
is as follows:
Mutable<T>
using makeMutable(...)
Immutable<T>
The reason that Mutable<T>
exists, rather than simply using a std::unique_ptr<T>
, is to take advantage of the underlying single-allocation optimization provided by std::make_shared
.
Definition at line 22 of file immutable.hpp.
|
defaultnoexcept |
|
delete |
|
inline |
Definition at line 30 of file immutable.hpp.
|
inline |
Definition at line 32 of file immutable.hpp.
|
inline |
Definition at line 31 of file immutable.hpp.
|
delete |
|
defaultnoexcept |
Definition at line 40 of file immutable.hpp.
|
friend |
Definition at line 53 of file immutable.hpp.