MCRO
C++23 utilities for Unreal Engine.
Loading...
Searching...
No Matches
Mcro::Inheritance Namespace Reference

Namespaces

namespace  Detail
 

Data Structures

class  TInherit
 Inherit via this template to allow other API to reflect upon the base types of deriving class. Base types are inherited as public. If you want privately inherited base classes, just inherit them as normal. More...
 

Concepts

concept  CHasBases
 Some MCRO utilities allow for intrusive method of declaring inheritance which can be later used to reflect upon base classes of a derived type.
 
concept  CHasExplicitBase
 

Functions

template<typename T , typename Function >
requires (CHasBases<T> || CIsTypeList<T>)
constexpr void ForEachExplicitBase (Function &&function)
 Operate on each of the explicitly listed base classes of a given type with a lambda function template. If any given type also happens to match CHasBases, iterate on their base types too recursively. Works directly with CHasBases or type lists (CIsTypeList).
 
template<typename T , typename Bases >
requires (CHasBases<Bases> || CIsTypeList<Bases>)
constexpr bool HasExplicitBase ()
 

Function Documentation

◆ ForEachExplicitBase()

template<typename T , typename Function >
requires (CHasBases<T> || CIsTypeList<T>)
void Mcro::Inheritance::ForEachExplicitBase ( Function && function)
constexpr

Operate on each of the explicitly listed base classes of a given type with a lambda function template. If any given type also happens to match CHasBases, iterate on their base types too recursively. Works directly with CHasBases or type lists (CIsTypeList).

Usage:

class FMyClass : public TInherit<FFoo, FBar>
{...}
{
UE_LOG(LogTemp, Display, TEXT_"%s", *TTypeString<T>())
});
#define TEXT_
A convenience alternative to Unreal's own TEXT macro but this one doesn't require parenthesis around ...
Definition TextMacros.h:53
Inherit via this template to allow other API to reflect upon the base types of deriving class....
constexpr void ForEachExplicitBase(Function &&function)
Operate on each of the explicitly listed base classes of a given type with a lambda function template...
Definition Inheritance.h:83
Template Parameters
TA type which uses TInherit or has a TTypes list member-aliased as Bases
FunctionType of per-base operation
Parameters
functionPer-base operation

Definition at line 83 of file Inheritance.h.

◆ HasExplicitBase()

template<typename T , typename Bases >
requires (CHasBases<Bases> || CIsTypeList<Bases>)
bool Mcro::Inheritance::HasExplicitBase ( )
constexpr

Definition at line 93 of file Inheritance.h.