UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TVariantTraits< T > Struct Template Reference

#include <Variant.h>

Static Public Member Functions

static constexpr EVariantTypes GetType ()
 

Detailed Description

template<typename T>
struct TVariantTraits< T >

Stub for variant type traits.

Actual type traits need to be declared through template specialization for custom data types that are to be used in FVariant. Traits for the most commonly used built-in types are declared below.

Complex types, such as structures and classes can be serialized into a byte array and then assigned to a variant. Note that you will be responsible for ensuring correct byte ordering when serializing those types.

Parameters
TThe type to be used in FVariant.

Member Function Documentation

◆ GetType()

template<typename T >
static constexpr EVariantTypes TVariantTraits< T >::GetType ( )
inlinestaticconstexpr

The documentation for this struct was generated from the following file: