MoveTempIfPossible

MoveTemp will cast a reference to an rvalue reference.

Windows
MacOS
Linux

References

Module

Core

Header

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

Include

#include "Templates/UnrealTemplate.h"

Syntax

template<typename T>
TRemoveReference< T >::Type && MoveTempIfPossible
(
    T && Obj
)

Remarks

MoveTemp will cast a reference to an rvalue reference. This is UE's equivalent of std::move. It doesn't static assert like MoveTemp, because it is useful in templates or macros where it's not obvious what the argument is, but you want to take advantage of move semantics where you can but not stop compilation.

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