TVariantTraits

Stub for variant type traits.

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Misc/Variant.h

Include

#include "Misc/Variant.h"

Syntax

template<typename T>
struct TVariantTraits

Remarks

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.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss