MCRO
C++23 utilities for Unreal Engine.
Loading...
Searching...
No Matches
Templates.h File Reference
#include "CoreMinimal.h"
#include "Mcro/Concepts.h"

Go to the source code of this file.

Data Structures

struct  Mcro::Templates::Detail::TTypeAtPack_Impl< I, First, Rest >
 
struct  Mcro::Templates::Detail::TTypeAtPack_Impl< 0, First, Rest... >
 
struct  Mcro::Templates::TTypeAtPack_Struct< I, T >
 
struct  Mcro::Templates::TTypeAtPack_Struct< I >
 
struct  Mcro::Templates::TTupleSafeElement_Struct< I, T >
 
struct  Mcro::Templates::TTupleSafeElement_Struct< I, TTuple< T... > >
 
struct  Mcro::Templates::TTypes< T >
 This template is used to store pack of types in other templates, or to allow parameter pack inference for functions. This template may be referred to as 'type-list' in other parts of the documentation. More...
 
struct  Mcro::Templates::TIsTypeList_Struct< T >
 
struct  Mcro::Templates::TIsTypeList_Struct< TTypes< T... > >
 
struct  Mcro::Templates::TTemplate< Template >
 Base struct containing traits of specified template (which only accepts type parameters) More...
 
struct  Mcro::Templates::TTemplate< Template >::Parameters< T >
 
struct  Mcro::Templates::TTemplate< Template >::Parameters< Template< Params... > >
 
struct  Mcro::Templates::TTemplate< Template >::ParametersDecay< T >
 
struct  Mcro::Templates::TTemplate< Template >::ParametersDecay< Template< Params... > >
 

Namespaces

namespace  Mcro
 
namespace  Mcro::Templates
 This namespace provides templating utilities and introspection into template instantiations.
 
namespace  Mcro::Templates::Detail
 

Concepts

concept  Mcro::Templates::CIsTypeList
 Concept constraining a given type to TTypes
 
concept  Mcro::Templates::CIsTemplate
 Check if given type is an instantiation of a given template (which only accepts type parameters)
 

Typedefs

template<size_t I, typename... Rest>
using Mcro::Templates::TTypeAtPack = typename TTypeAtPack_Struct<I, Rest...>::Type
 Get a specific item from a parameter pack at given index. It is an unspecified compile error to index an empty parameter pack.
 
template<size_t I, typename... Rest>
using Mcro::Templates::TLastTypeAtPack = typename TTypeAtPack_Struct<sizeof...(Rest) - I, Rest...>::Type
 Get a specific item from the end of a parameter pack at given index (0 == last). It is an unspecified compile error to index an empty parameter pack.
 
template<size_t I, typename... Rest>
using Mcro::Templates::TTypeAtPackDecay = std::decay_t<typename TTypeAtPack_Struct<I, Rest...>::Type>
 Get a specific item from a parameter pack at given index disregarding CV-ref qualifiers. It is an unspecified compile error to index an empty parameter pack.
 
template<size_t I, typename... Rest>
using Mcro::Templates::TLastTypeAtPackDecay = std::decay_t<typename TTypeAtPack_Struct<sizeof...(Rest) - I, Rest...>::Type>
 Get a specific item from the end of a parameter pack at given index (0 == last) disregarding CV-ref qualifiers. It is an unspecified compile error to index an empty parameter pack.
 
template<CIsTypeList T, size_t I>
using Mcro::Templates::TTypes_Get = T::template Get<I>
 
template<CIsTypeList T, size_t I>
using Mcro::Templates::TTypes_GetDecay = T::template GetDecay<I>
 
template<template< typename... > typename Template, typename Instance >
using Mcro::Templates::TTemplate_Params = typename TTemplate<Template>::template Parameters<Instance>::Type
 Get template type parameters as a tuple.
 
template<template< typename... > typename Template, typename Instance >
using Mcro::Templates::TTemplate_ParamsDecay = typename TTemplate<Template>::template ParametersDecay<Instance>::Type
 Get decayed template type parameters as a tuple.
 
template<template< typename... > typename Template, typename Instance , int I>
using Mcro::Templates::TTemplate_Param = typename TTemplate<Template>::template Param<Instance, I>
 Get a type parameter at a specified position of a templated instance.
 
template<template< typename... > typename Template, typename Instance , int I>
using Mcro::Templates::TTemplate_ParamDecay = typename TTemplate<Template>::template ParamDecay<Instance, I>
 Get a decayed type parameter at a specified position of a templated instance.
 

Functions

template<CConstType T>
constexpr auto && Mcro::Templates::AsConst (T &&input)
 Tired of typing const_cast<FMyLongUnwieldyTypeName>(...)? use this instead.
 
template<CMutableType T>
constexpr auto && Mcro::Templates::AsMutable (T &&input)
 Tired of typing const_cast<FMyLongUnwieldyTypeName>(...)? use this instead.
 
template<typename T >
constexpr auto Mcro::Templates::AsConstPtr (const T *input)
 Tired of typing const_cast<FMyLongUnwieldyTypeName*>(...)? use this instead.
 
template<typename T >
constexpr auto Mcro::Templates::AsConstPtr (T *input)
 Tired of typing const_cast<FMyLongUnwieldyTypeName*>(...)? use this instead.
 
template<typename T >
constexpr auto Mcro::Templates::AsMutablePtr (T *input)
 Tired of typing const_cast<FMyLongUnwieldyTypeName*>(...)? use this instead.
 
template<typename T >
constexpr auto Mcro::Templates::AsMutablePtr (const T *input)
 Tired of typing const_cast<FMyLongUnwieldyTypeName*>(...)? use this instead.
 

Variables

template<template< typename... > typename Template, typename Instance >
constexpr size_t Mcro::Templates::TTemplate_ParamCount = TTemplate<Template>::template ParameterCount<Instance>
 Get the number of template type parameters from a specified templated instance (which only has type parameters)
 

Detailed Description

Author
David Mórász
Date
2025

Definition in file Templates.h.