Ark Server API (ASA) - Wiki
|
#include "CoreTypes.h"
#include "Templates/IsPointer.h"
#include "HAL/UnrealMemory.h"
#include "Templates/EnableIf.h"
#include "Templates/AndOrNot.h"
#include "Templates/CopyQualifiersAndRefsFromTo.h"
#include "Templates/IsArithmetic.h"
#include "Templates/UnrealTypeTraits.h"
#include "Templates/RemoveReference.h"
#include "Templates/TypeCompatibleBytes.h"
#include "Templates/Identity.h"
#include "Traits/IsContiguousContainer.h"
#include <type_traits>
Go to the source code of this file.
Classes | |
class | FNoncopyable |
struct | TGuardValue< RefType, AssignedType > |
struct | TGuardValue_Bitfield_Cleanup< FuncType > |
struct | TScopeCounter< Type > |
struct | TKeyValuePair< KeyType, ValueType > |
struct | TRemovePointer< T > |
struct | TRemovePointer< T * > |
struct | TUseBitwiseSwap< T > |
struct | TRValueToLValueReference< T > |
struct | TRValueToLValueReference< T && > |
struct | TForceInitAtBoot< T > |
struct | FNoopStruct |
Macros | |
#define | UE_ARRAY_COUNT(array) (sizeof(UEArrayCountHelper(array)) - 1) |
#define | STRUCT_OFFSET(struc, member) offsetof(struc, member) |
#define | VTABLE_OFFSET(Class, MultipleInheritenceParent) ( ((PTRINT) static_cast<MultipleInheritenceParent*>((Class*)1)) - 1) |
#define | FGuardValue_Bitfield(ReferenceValue, NewValue) |
#define | TEMPLATE_PARAMETERS2(X, Y) X,Y |
#define FGuardValue_Bitfield | ( | ReferenceValue, | |
NewValue ) |
Macro variant on TGuardValue<bool> that can deal with bitfields which cannot be passed by reference in to TGuardValue
Definition at line 373 of file UnrealTemplate.h.
Definition at line 223 of file UnrealTemplate.h.
#define UE_ARRAY_COUNT | ( | array | ) | (sizeof(UEArrayCountHelper(array)) - 1) |
Definition at line 217 of file UnrealTemplate.h.
#define VTABLE_OFFSET | ( | Class, | |
MultipleInheritenceParent ) ( ((PTRINT) static_cast<MultipleInheritenceParent*>((Class*)1)) - 1) |
Definition at line 229 of file UnrealTemplate.h.
Disallowed for rvalue references because it cannot extend their lifetime.
Returns a non-const reference type as const.
Definition at line 140 of file UnrealTemplate.h.
Returns a non-const pointer type as const.
Definition at line 131 of file UnrealTemplate.h.
Returns a non-const pointer type as const.
Definition at line 121 of file UnrealTemplate.h.
|
constexpr |
Returns a non-const reference type as const. This overload is only required until the pointer overloads are removed.
Definition at line 156 of file UnrealTemplate.h.
FORCEINLINE T BitMask | ( | uint32 | Count | ) |
Generates a bitmask with a given number of bits set.
FORCEINLINE uint16 BitMask< uint16 > | ( | uint32 | Count | ) |
Definition at line 651 of file UnrealTemplate.h.
FORCEINLINE uint32 BitMask< uint32 > | ( | uint32 | Count | ) |
Definition at line 644 of file UnrealTemplate.h.
FORCEINLINE uint64 BitMask< uint64 > | ( | uint32 | Count | ) |
Definition at line 637 of file UnrealTemplate.h.
FORCEINLINE uint8 BitMask< uint8 > | ( | uint32 | Count | ) |
Definition at line 658 of file UnrealTemplate.h.
Definition at line 504 of file UnrealTemplate.h.
FORCEINLINE T && CopyTemp | ( | T && | Val | ) |
Definition at line 511 of file UnrealTemplate.h.
FORCEINLINE T CopyTemp | ( | T & | Val | ) |
CopyTemp will enforce the creation of a prvalue which can bind to rvalue reference parameters. Unlike MoveTemp, a source lvalue will never be modified. (i.e. a copy will always be made) There is no std:: equivalent, though there is the exposition function std::decay-copy: https://eel.is/c++draft/expos.only.func CopyTemp(<rvalue>) is regarded as an error and will not compile, similarly to how MoveTemp(<rvalue>) does not compile, and CopyTempIfNecessary should be used instead when the nature of the argument is not known in advance.
Definition at line 498 of file UnrealTemplate.h.
FORCEINLINE std::decay_t< T > CopyTempIfNecessary | ( | T && | Val | ) |
CopyTempIfNecessary will enforce the creation of a prvalue. This is UE's equivalent of the exposition std::decay-copy: https://eel.is/c++draft/expos.only.func It doesn't static assert like CopyTemp, because it is useful in templates or macros where it's not obvious what the argument is, but you want to create a PR value without stopping compilation.
Definition at line 534 of file UnrealTemplate.h.
Equivalent to std::declval.
Note that this function is unimplemented, and is only intended to be used in unevaluated contexts, like sizeof and trait expressions.
Definition at line 590 of file UnrealTemplate.h.
Definition at line 198 of file UnrealTemplate.h.
Test if value can make a static_cast roundtrip via OutType whilst maintaining precision
Definition at line 189 of file UnrealTemplate.h.
FORCEINLINE T && Forward | ( | typename TRemoveReference< T >::Type && | Obj | ) |
Definition at line 550 of file UnrealTemplate.h.
FORCEINLINE T && Forward | ( | typename TRemoveReference< T >::Type & | Obj | ) |
Forward will cast a reference to an rvalue reference. This is UE's equivalent of std::forward.
Definition at line 544 of file UnrealTemplate.h.
FORCEINLINE decltype(auto) ForwardAsBase | ( | typename TRemoveReference< T >::Type && | Obj | ) |
Definition at line 727 of file UnrealTemplate.h.
FORCEINLINE decltype(auto) ForwardAsBase | ( | typename TRemoveReference< T >::Type & | Obj | ) |
ForwardAsBase will cast a reference to an rvalue reference of a base type. This allows the perfect forwarding of a reference as a base class.
Definition at line 717 of file UnrealTemplate.h.
Definition at line 82 of file UnrealTemplate.h.
Definition at line 81 of file UnrealTemplate.h.
Definition at line 85 of file UnrealTemplate.h.
Generically gets the data pointer of a contiguous container
Definition at line 74 of file UnrealTemplate.h.
Definition at line 80 of file UnrealTemplate.h.
Definition at line 79 of file UnrealTemplate.h.
Definition at line 102 of file UnrealTemplate.h.
Definition at line 101 of file UnrealTemplate.h.
Gets the number of items in an initializer list.
The return type is int32 for compatibility with other code in the engine. Realistically, an initializer list should not exceed the limits of int32.
Definition at line 111 of file UnrealTemplate.h.
|
constexpr |
Generically gets the number of items in a contiguous container
Definition at line 94 of file UnrealTemplate.h.
Definition at line 100 of file UnrealTemplate.h.
Definition at line 99 of file UnrealTemplate.h.
FORCEINLINE ReferencedType * IfAThenAElseB | ( | ReferencedType * | A, |
ReferencedType * | B ) |
Chooses between the two parameters based on whether the first is nullptr or not.
Definition at line 28 of file UnrealTemplate.h.
FORCEINLINE ReferencedType * IfPThenAElseB | ( | PredicateType | Predicate, |
ReferencedType * | A, | ||
ReferencedType * | B ) |
branchless pointer selection based on predicate return PTRINT(Predicate) ? A : B;
Definition at line 37 of file UnrealTemplate.h.
Uses implicit conversion to create an instance of a specific type. Useful to make things clearer or circumvent unintended type deduction in templates. Safer than C casts and static_casts, e.g. does not allow down-casts
Obj | The object (usually pointer or reference) to convert. |
Definition at line 703 of file UnrealTemplate.h.
Cast and check that value fits in OutType
Definition at line 181 of file UnrealTemplate.h.
Test if value can make a lossless static_cast roundtrip via OutType without a sign change
Definition at line 163 of file UnrealTemplate.h.
works just like std::max_element.
Definition at line 271 of file UnrealTemplate.h.
|
inline |
works just like std::max_element.
Definition at line 288 of file UnrealTemplate.h.
works just like std::min_element.
Definition at line 237 of file UnrealTemplate.h.
|
inline |
works just like std::min_element.
Definition at line 254 of file UnrealTemplate.h.
FORCEINLINE void Move | ( | T & | A, |
typename TMoveSupportTraits< T >::Copy | B ) |
This is used to provide type specific behavior for a copy which cannot change the value of B.
Definition at line 50 of file UnrealTemplate.h.
FORCEINLINE void Move | ( | T & | A, |
typename TMoveSupportTraits< T >::Move | B ) |
This is used to provide type specific behavior for a move which may change the value of B.
Definition at line 61 of file UnrealTemplate.h.
FORCEINLINE TRemoveReference< T >::Type && MoveTemp | ( | T && | Obj | ) |
MoveTemp will cast a reference to an rvalue reference. This is UE's equivalent of std::move except that it will not compile when passed an rvalue or const object, because we would prefer to be informed when MoveTemp will have no effect.
Definition at line 464 of file UnrealTemplate.h.
FORCEINLINE TRemoveReference< T >::Type && MoveTempIfPossible | ( | T && | Obj | ) |
MoveTempIfPossible 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.
Definition at line 482 of file UnrealTemplate.h.
Reverses the order of the bits of a value. This is an TEnableIf'd template to ensure that no undesirable conversions occur. Overloads for other types can be added in the same way.
Bits | - The value to bit-swap. |
Definition at line 620 of file UnrealTemplate.h.
FORCEINLINE T StaticCast | ( | ArgType && | Arg | ) |
This exists to avoid a Visual Studio bug where using a cast to forward an rvalue reference array argument to a pointer parameter will cause bad code generation. Wrapping the cast in a function causes the correct code to be generated.
Definition at line 601 of file UnrealTemplate.h.
Swap two values. Assumes the types are trivially relocatable.
Definition at line 570 of file UnrealTemplate.h.
Definition at line 582 of file UnrealTemplate.h.
A logical exclusive or function.
Definition at line 43 of file UnrealTemplate.h.