MCRO
C++23 utilities for Unreal Engine.
Loading...
Searching...
No Matches
Mcro::InitializeOnCopy::TInitializeOnCopy< T > Struct Template Reference

A type wrapper around a default initializeable object which may not be copyable but which needs to be a member of a copyable class. On each instance of such class the wrapped value may not need to be copied and default constructing it is enough. Useful for mutexes for example. More...

#include <InitializeOnCopy.h>

Public Member Functions

 TInitializeOnCopy ()
 
 TInitializeOnCopy (TInitializeOnCopy const &)
 
 TInitializeOnCopy (TInitializeOnCopy &&) noexcept
 
auto operator= (TInitializeOnCopy const &) -> TInitializeOnCopy &
 
auto operator= (TInitializeOnCopy &&other) noexcept -> TInitializeOnCopy &
 
T * operator-> ()
 
const T * operator-> () const
 
T & Get ()
 
const T & Get () const
 
template<typename Self >
 operator typename TCopyQualifiersFromTo< Self, T & >::Type (this Self &&self)
 

Data Fields

TUniqueObj< T > Value
 

Detailed Description

template<CDefaultInitializable T>
requires (!CCopyable<T>)
struct Mcro::InitializeOnCopy::TInitializeOnCopy< T >

A type wrapper around a default initializeable object which may not be copyable but which needs to be a member of a copyable class. On each instance of such class the wrapped value may not need to be copied and default constructing it is enough. Useful for mutexes for example.

Definition at line 29 of file InitializeOnCopy.h.

Constructor & Destructor Documentation

◆ TInitializeOnCopy() [1/3]

template<CDefaultInitializable T>
Mcro::InitializeOnCopy::TInitializeOnCopy< T >::TInitializeOnCopy ( )
inline

Definition at line 31 of file InitializeOnCopy.h.

◆ TInitializeOnCopy() [2/3]

template<CDefaultInitializable T>
Mcro::InitializeOnCopy::TInitializeOnCopy< T >::TInitializeOnCopy ( TInitializeOnCopy< T > const & )
inline

Definition at line 32 of file InitializeOnCopy.h.

◆ TInitializeOnCopy() [3/3]

template<CDefaultInitializable T>
Mcro::InitializeOnCopy::TInitializeOnCopy< T >::TInitializeOnCopy ( TInitializeOnCopy< T > && )
inlinenoexcept

Definition at line 33 of file InitializeOnCopy.h.

Member Function Documentation

◆ Get() [1/2]

template<CDefaultInitializable T>
T & Mcro::InitializeOnCopy::TInitializeOnCopy< T >::Get ( )
inline

Definition at line 42 of file InitializeOnCopy.h.

◆ Get() [2/2]

template<CDefaultInitializable T>
const T & Mcro::InitializeOnCopy::TInitializeOnCopy< T >::Get ( ) const
inline

Definition at line 43 of file InitializeOnCopy.h.

◆ operator typename TCopyQualifiersFromTo< Self, T & >::Type()

template<CDefaultInitializable T>
template<typename Self >
Mcro::InitializeOnCopy::TInitializeOnCopy< T >::operator typename TCopyQualifiersFromTo< Self, T & >::Type ( this Self && self)
inline

Definition at line 46 of file InitializeOnCopy.h.

◆ operator->() [1/2]

template<CDefaultInitializable T>
T * Mcro::InitializeOnCopy::TInitializeOnCopy< T >::operator-> ( )
inline

Definition at line 39 of file InitializeOnCopy.h.

◆ operator->() [2/2]

template<CDefaultInitializable T>
const T * Mcro::InitializeOnCopy::TInitializeOnCopy< T >::operator-> ( ) const
inline

Definition at line 40 of file InitializeOnCopy.h.

◆ operator=() [1/2]

template<CDefaultInitializable T>
auto Mcro::InitializeOnCopy::TInitializeOnCopy< T >::operator= ( TInitializeOnCopy< T > && other) -> TInitializeOnCopy&
inlinenoexcept

Definition at line 35 of file InitializeOnCopy.h.

◆ operator=() [2/2]

template<CDefaultInitializable T>
auto Mcro::InitializeOnCopy::TInitializeOnCopy< T >::operator= ( TInitializeOnCopy< T > const & ) -> TInitializeOnCopy&
inline

Definition at line 34 of file InitializeOnCopy.h.

Field Documentation

◆ Value

template<CDefaultInitializable T>
TUniqueObj<T> Mcro::InitializeOnCopy::TInitializeOnCopy< T >::Value

Definition at line 37 of file InitializeOnCopy.h.


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