![]() |
MCRO
C++23 utilities for Unreal Engine.
|
Data Structures | |
struct | FType |
Group together type info for identification. Can have an invalid state when no type is specified. More... | |
Functions | |
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 FType | TTypeOf = FType(FType::TTag<T>()) |
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 uint64 | TTypeHash = GetCompileTimeTypeHash<T>() |
Get a fixed uint64 hash representation of the given type. Have similar caveats as TTypeName | |
Convert types to string
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 213 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 223 of file TypeName.h.
|
constexpr |
Get a fixed uint64
hash representation of the given type. Have similar caveats as TTypeName
Definition at line 206 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 195 of file TypeName.h.
|
constexpr |
Same as TTypeName
just stored as STL string made during compile time.
Definition at line 202 of file TypeName.h.
|
constexpr |
Definition at line 144 of file TypeName.h.