LkEngine 0.1.2
 
Loading...
Searching...
No Matches
LkEngine::TSubclassOf< T > Class Template Reference

Public Member Functions

 TSubclassOf (TSubclassOf &&)=default
 
 TSubclassOf (const TSubclassOf &)=default
 
TSubclassOfoperator= (TSubclassOf &&)=default
 
TSubclassOfoperator= (const TSubclassOf &)=default
 
FORCEINLINE TSubclassOf (LClass *From)
 
template<typename R , std::enable_if_t< !TIsTSubclassOf< std::decay_t< R > >::Value, decltype(ImplicitConv< LClass * >(std::declval< R >())) > * = nullptr>
FORCEINLINE TSubclassOf (R &&From)
 Create TSubclassOf instance from any type that can be implicitly converted to LClass*.
 
FORCEINLINE TSubclassOfoperator= (LClass *From)
 Assign from a LClass pointer.
 
template<typename R , std::enable_if_t< !TIsTSubclassOf< std::decay_t< R > >::Value, decltype(ImplicitConv< LClass * >(std::declval< R >())) > * = nullptr>
FORCEINLINE TSubclassOfoperator= (R &&From)
 Assigns a compatible object to the TSubclassOf instance, enabling implicit conversion to LClass*.
 
FORCEINLINE LClassoperator* () const
 Dereference back into a LClass pointer.
 
FORCEINLINE LClassGet () const
 Dereference back into a LClass pointer.
 
FORCEINLINE LClassoperator-> () const
 Dereference back into a LClass pointer.
 
FORCEINLINE operator LClass * () const
 Implicit conversion to LClass pointer.
 

Constructor & Destructor Documentation

◆ TSubclassOf()

template<typename T >
template<typename R , std::enable_if_t< !TIsTSubclassOf< std::decay_t< R > >::Value, decltype(ImplicitConv< LClass * >(std::declval< R >())) > * = nullptr>
FORCEINLINE LkEngine::TSubclassOf< T >::TSubclassOf ( R && From)
inline

Create TSubclassOf instance from any type that can be implicitly converted to LClass*.

This constructor enables implicit conversion of an input object to the LClass* base pointer type, provided the input type is not already a TSubclassOf. Doing this allows the safe initialization of TSubclassOf with objects derived from LClass. It restricts unsafe conversions, such as downcasting or conversions from unrelated types.

Template Parameters
RThe type of the object used to initialize the TSubclassOf instance.
Parameters
FromAn object of type R that is implicitly convertible to LClass*. Commonly used for initializing TSubclassOf with derived types of LClass.

Member Function Documentation

◆ operator=()

template<typename T >
template<typename R , std::enable_if_t< !TIsTSubclassOf< std::decay_t< R > >::Value, decltype(ImplicitConv< LClass * >(std::declval< R >())) > * = nullptr>
FORCEINLINE TSubclassOf & LkEngine::TSubclassOf< T >::operator= ( R && From)
inline

Assigns a compatible object to the TSubclassOf instance, enabling implicit conversion to LClass*.

Allows an object of type R to be assigned to TSubclassOf. Provided that R can be implicitly converted to LClass* and is not already a TSubclassOf type. This enables safe assignment of derived LClass objects or other compatible types to TSubclassOf, preventing unsafe downcasts or conversions from unrelated types.

Template Parameters
RThe type of the object being assigned to this TSubclassOf instance.
Parameters
FromAn object of type R that is implicitly convertible to LClass*. Commonly used to assign a derived class of LClass or another compatible object.
Returns
A reference to this TSubclassOf instance.

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