![]() |
MCRO
C++23 utilities for Unreal Engine.
|
Typedefs | |
| using | FTypeHash = uint64 |
Functions | |
| template<typename T > | |
| consteval FTypeHash | GetCompileTimeTypeHash () |
| template<typename T > | |
| FName | TTypeFName () |
Same as TTypeName converted to FName. This is not cached and a new FName is created every time this is called. | |
| template<typename T > | |
| FString | TTypeString () |
Same as TTypeName converted to FString. This is not cached and a new FString is created every time this is called. | |
Variables | |
| template<typename T > | |
| constexpr FStringView | TTypeName |
Get a friendly string of an input type without using typeid(T).name(). | |
| template<typename T > | |
| constexpr std::basic_string_view< TCHAR > | TTypeNameStd = GetCompileTimeTypeName<std::decay_t<T>>() |
Same as TTypeName just stored as STL string made during compile time. | |
| template<typename T > | |
| constexpr FTypeHash | TTypeHash = GetCompileTimeTypeHash<T>() |
Get a fixed uint64 hash representation of the given type. Have similar caveats as TTypeName | |
Convert types to string
| using Mcro::TypeName::FTypeHash = uint64 |
Definition at line 103 of file TypeName.h.
|
consteval |
Definition at line 106 of file TypeName.h.
| FName Mcro::TypeName::TTypeFName | ( | ) |
Same as TTypeName converted to FName. This is not cached and a new FName is created every time this is called.
Definition at line 179 of file TypeName.h.
| FString Mcro::TypeName::TTypeString | ( | ) |
Same as TTypeName converted to FString. This is not cached and a new FString is created every time this is called.
Definition at line 189 of file TypeName.h.
|
constexpr |
Get a fixed uint64 hash representation of the given type. Have similar caveats as TTypeName
Definition at line 172 of file TypeName.h.
|
constexpr |
Get a friendly string of an input type without using typeid(T).name().
Actually this method gives more predictable results across compilers than typeid(T).name() but still not 100% the same. Besides TTypeName can deal with incomplete types as well, whereas typeid(T) cannot (more on this in remarks). While it is more consistent across compilers, it is still not 100% consistent. Take templated types for instance where MSVC compiler will add "class" prefix in front of type arguments where GCC or CLang might not. Because of subtle differences like this, it is strongly discouraged to assume the exact format of the output of TTypeName
Usage:
It is useful in templates where a type name should be known in runtime as well. (e.g.: Modular features)
TTypeName<class I> of incomplete I might not be the same as TTypeName<I> somewhere else with I being fully defined)| T | The type to be named |
Definition at line 161 of file TypeName.h.
|
constexpr |
Same as TTypeName just stored as STL string made during compile time.
Definition at line 168 of file TypeName.h.