MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ make_persistent() [2/2]

template<typename T >
std::decay_t< T > & MayaFlux::make_persistent ( T &&  val)

Store a value in the persistent store and return a reference to it.

Template Parameters
TDeduced from the argument.
Parameters
valValue to store. Moved into a shared_ptr internally.
Returns
Reference to the stored object. Lifetime is the process lifetime.

Definition at line 102 of file Persist.hpp.

103{
104 auto ptr = std::make_shared<std::decay_t<T>>(std::forward<T>(val));
105 auto& ref = *ptr;
106 internal::persistent_store().push_back(std::static_pointer_cast<void>(std::move(ptr)));
107 return ref;
108}

References MayaFlux::internal::persistent_store().

+ Here is the call graph for this function: