TMoveSupportTraits

This traits class is intended to be used in pairs to allow efficient and correct move-aware overloads for generic types.

Windows
MacOS
Linux

Inheritance Hierarchy

TMoveSupportTraitsBase

TMoveSupportTraits

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Templates/UnrealTypeTraits.h

Include

#include "Templates/UnrealTypeTraits.h"

Syntax

template<typename T>
struct TMoveSupportTraits : public TMoveSupportTraitsBase< T, TCallTraits< T >::ParamType >

Remarks

This traits class is intended to be used in pairs to allow efficient and correct move-aware overloads for generic types. For example:

template <typename t>=""> void Func(typename TMoveSupportTraits<T>::Copy Obj) { Copy Obj here }

template <typename t>=""> void Func(typename TMoveSupportTraits<T>::Move Obj) { Move from Obj here as if it was passed as T&& }

Structuring things in this way will handle T being a pass-by-value type (e.g. ints, floats, other 'small' types) which should never have a reference overload.

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