Ark Server API (ASE) - Wiki
|
#include "../BasicTypes.h"
#include "AreTypesEqual.h"
#include "UnrealTemplate.h"
#include "Decay.h"
#include "../Delegates/IntegerSequence.h"
Go to the source code of this file.
Namespaces | |
namespace | UE4Tuple_Private |
Macros | |
#define | USE_TUPLE_AUTO_RETURN_TYPES 1 |
#define | TUPLES_USE_DEFAULTED_FUNCTIONS 1 |
Functions | |
template<typename... Types> | |
TTuple< typename TDecay< Types >::Type... > | MakeTuple (Types &&... Args) |
template<typename FuncType , typename... Types> | |
FORCEINLINE decltype(auto) | TransformTuple (TTuple< Types... > &&Tuple, FuncType Func) |
template<typename FuncType , typename... Types> | |
FORCEINLINE decltype(auto) | TransformTuple (const TTuple< Types... > &Tuple, FuncType Func) |
template<typename TupleType , typename FuncType > | |
FORCEINLINE void | VisitTupleElements (TupleType &Tuple, FuncType Func) |
TTuple< typename TDecay< Types >::Type... > MakeTuple | ( | Types &&... | Args | ) |
Makes a TTuple from some arguments. The type of the TTuple elements are the decayed versions of the arguments.
Args | The arguments used to construct the tuple. |
Example:
void Func(const int32 A, FString&& B) { // Equivalent to: // TTuple<int32, const TCHAR*, FString> MyTuple(A, TEXT("Hello"), MoveTemp(B)); auto MyTuple = MakeTuple(A, TEXT("Hello"), MoveTemp(B)); }
FORCEINLINE decltype(auto) TransformTuple | ( | const TTuple< Types... > & | Tuple, |
FuncType | Func ) |
FORCEINLINE decltype(auto) TransformTuple | ( | TTuple< Types... > && | Tuple, |
FuncType | Func ) |
Creates a new TTuple by applying a functor to each of the elements.
Tuple | The tuple to apply the functor to. |
Func | The functor to apply. |
Example:
float Overloaded(int32 Arg); char Overloaded(const TCHAR* Arg); const TCHAR* Overloaded(const FString& Arg);
void Func(const TTuple<int32, const TCHAR*, FString>& MyTuple) { // Equivalent to: // TTuple<float, char, const TCHAR*> TransformedTuple(Overloaded(MyTuple.Get<0>()), Overloaded(MyTuple.Get<1>()), Overloaded(MyTuple.Get<2>()))); auto TransformedTuple = TransformTuple(MyTuple, [](const auto& Arg) { return Overloaded(Arg); }); }
FORCEINLINE void VisitTupleElements | ( | TupleType & | Tuple, |
FuncType | Func ) |