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

Data Structures

struct  TTemplate
 

Concepts

concept  CIsTemplate
 

Typedefs

template<template< typename... > typename Template, typename T >
using TTemplate_Params = typename TTemplate<Template>::template Parameters<T>::Type
 

Functions

template<CConstType T>
auto AsConst (T &&input)
 
template<CMutableType T>
auto AsMutable (T &&input)
 
template<typename T >
auto AsConstPtr (const T *input)
 
template<typename T >
auto AsConstPtr (T *input)
 
template<typename T >
auto AsMutablePtr (T *input)
 
template<typename T >
auto AsMutablePtr (const T *input)
 

Detailed Description

This namespace provide some introspection into template instantiations.

Warning
Members of this namespace is very limited in usage and therefore should be used with utmost care. Until this proposal https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1985r0.pdf or equivalent is considered seriously, template traits only work with templates which only have type-parameters. Non-type parameters even when a default is specified for them will result in compile error.

Typedef Documentation

◆ TTemplate_Params

template<template< typename... > typename Template, typename T >
using Mcro::Templates::TTemplate_Params = typename TTemplate<Template>::template Parameters<T>::Type

Get template type parameters as a tuple

Warning
Until this proposal https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1985r0.pdf or equivalent is considered seriously, template traits only work with templates which only have type-parameters. Non-type parameters even when a default is specified for them will result in compile error.

Definition at line 69 of file Templates.h.

Function Documentation

◆ AsConst()

template<CConstType T>
auto Mcro::Templates::AsConst ( T && input)

Definition at line 83 of file Templates.h.

◆ AsConstPtr() [1/2]

template<typename T >
auto Mcro::Templates::AsConstPtr ( const T * input)

Definition at line 95 of file Templates.h.

◆ AsConstPtr() [2/2]

template<typename T >
auto Mcro::Templates::AsConstPtr ( T * input)

Definition at line 98 of file Templates.h.

◆ AsMutable()

template<CMutableType T>
auto Mcro::Templates::AsMutable ( T && input)

Definition at line 89 of file Templates.h.

◆ AsMutablePtr() [1/2]

template<typename T >
auto Mcro::Templates::AsMutablePtr ( const T * input)

Definition at line 104 of file Templates.h.

◆ AsMutablePtr() [2/2]

template<typename T >
auto Mcro::Templates::AsMutablePtr ( T * input)

Definition at line 101 of file Templates.h.