Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/TVariant
Overloads
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TVariant () |
Test for 255 here, because the parameter pack doesn't include the initial T. | Misc/TVariant.h | |
| Copy construct the variant from another variant of the same type | Misc/TVariant.h | ||
| Move construct the variant from another variant of the same type | Misc/TVariant.h | ||
TVariant
(
UE::Core::Private::TUninitializedType< U >&& |
INTERNAL USE ONLY Do not call this constructor, it will put the variant in a bad state. | Misc/TVariant.h | |
TVariant
(
TInPlaceType< U >&&, |
Perform in-place construction of a type into the variant | Misc/TVariant.h |
TVariant()
Description
Default initialize the TVariant to the first type in the parameter pack
| Name | TVariant |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Misc/TVariant.h |
| Include Path | #include "Misc/TVariant.h" |
TVariant()
TVariant(const TVariant &)
Description
Copy construct the variant from another variant of the same type
| Name | TVariant |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Misc/TVariant.h |
| Include Path | #include "Misc/TVariant.h" |
TVariant
(
const TVariant & Other
)
TVariant(TVariant &&)
Description
Move construct the variant from another variant of the same type
| Name | TVariant |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Misc/TVariant.h |
| Include Path | #include "Misc/TVariant.h" |
TVariant
(
TVariant && Other
)
TVariant(UE::Core::Private::TUninitializedType< U > &&)
Description
INTERNAL USE ONLY Do not call this constructor, it will put the variant in a bad state. Its internal use case is for in-place construction of non-default-constructible types during serialization.
Construct the TVariant to store the specified uninitialized element type. The caller must unconditionally get a pointer to the element and construct an object of the right type in that position. This is all totally exception-unsafe. This relies on undefined behavior by dereferencing a pointer to an object (inside Get) that doesn't exist, and then turning it back to an pointer. Any other attempts to use or destroy the variant before an object of the right type has been constructed is completely unsafe, it may e.g. result in trying to destroy an object that is not there.
| Name | TVariant |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Misc/TVariant.h |
| Include Path | #include "Misc/TVariant.h" |
template<typename U>
TVariant
(
UE::Core::Private::TUninitializedType < U > &&
)
TVariant(TInPlaceType< U > &&, ArgTypes &&...)
Description
Perform in-place construction of a type into the variant
| Name | TVariant |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Misc/TVariant.h |
| Include Path | #include "Misc/TVariant.h" |
template<typename U, typename... ArgTypes, std::enable_if_t<(std::is_constructible_v< U, ArgTypes... >), int >>
TVariant
(
TInPlaceType < U > &&,
ArgTypes &&... Args
)