Ark Server API (ASA) - Wiki
|
#include "CoreTypes.h"
#include "Templates/IsFloatingPoint.h"
#include "Templates/UnrealTypeTraits.h"
#include "Templates/IsSigned.h"
#include "Templates/IsIntegral.h"
Go to the source code of this file.
#define MIX_FLOATS_2_ARGS | ( | Func | ) |
Definition at line 89 of file ResolveTypeAmbiguity.h.
#define MIX_FLOATS_3_ARGS | ( | Func | ) |
Definition at line 104 of file ResolveTypeAmbiguity.h.
#define MIX_FLOATS_TO_TYPE_2_ARGS | ( | Func, | |
ReturnType ) |
Definition at line 136 of file ResolveTypeAmbiguity.h.
#define MIX_FLOATS_TO_TYPE_3_ARGS | ( | Func, | |
ReturnType ) |
Definition at line 154 of file ResolveTypeAmbiguity.h.
#define MIX_SIGNED_INTS_2_ARGS | ( | Func | ) | MIX_SIGNED_INTS_2_ARGS_ACTUAL(Func,) |
Definition at line 56 of file ResolveTypeAmbiguity.h.
#define MIX_SIGNED_INTS_2_ARGS_ACTUAL | ( | Func, | |
OptionalMarkup ) |
This file defines a few macros which can be used to restrict (via deprecation) ambiguous calls to functions expecting float params/return type. This also handles mixing of argument types where at least one argument is a float/double and the rest can be promoted to the highest-precision type to infer the expected type of the return value, or where non-float arguments are mixed in a function where the result should be the result of mixed arithmetic between the types.
For example:
template< class T > static T MyFunc(const T X, const T Y) { return X < Y ? X : Y; } // Allows mixing of types without causing type ambiguity MIX_TYPES_2_ARGS(MyFunc);
static float Sin( float Value ) { return sinf(Value); } static double Sin( double Value ) { return sin(Value); }
static float Fmod(float X, float Y); static double Fmod(double X, double Y); // Disallows Fmod(int32, int32) because one argument must be a floating point type. // Promotes calls such as "Fmod(float, double)" or "Fmod(double, int)" to "double Fmod(double, double)" because double has the highest precision of the argument types. RESOLVE_FLOAT_AMBIGUITY_2_ARGS(Fmod);
Definition at line 38 of file ResolveTypeAmbiguity.h.
#define MIX_SIGNED_INTS_2_ARGS_CONSTEXPR | ( | Func | ) | MIX_SIGNED_INTS_2_ARGS_ACTUAL(Func, CONSTEXPR) |
Definition at line 57 of file ResolveTypeAmbiguity.h.
#define MIX_SIGNED_INTS_3_ARGS | ( | Func | ) | MIX_SIGNED_INTS_3_ARGS_ACTUAL(Func,) |
Definition at line 84 of file ResolveTypeAmbiguity.h.
#define MIX_SIGNED_INTS_3_ARGS_CONSTEXPR | ( | Func | ) | MIX_SIGNED_INTS_3_ARGS_ACTUAL(Func, CONSTEXPR) |
Definition at line 85 of file ResolveTypeAmbiguity.h.
#define MIX_SIGNED_TYPES_3_ARGS_ACTUAL | ( | Func, | |
OptionalMarkup ) |
Definition at line 60 of file ResolveTypeAmbiguity.h.
#define RESOLVE_FLOAT_AMBIGUITY_2_ARGS | ( | Func | ) | MIX_FLOATS_2_ARGS(Func); |
Definition at line 126 of file ResolveTypeAmbiguity.h.
#define RESOLVE_FLOAT_AMBIGUITY_3_ARGS | ( | Func | ) | MIX_FLOATS_3_ARGS(Func); |
Definition at line 129 of file ResolveTypeAmbiguity.h.
#define RESOLVE_FLOAT_PREDICATE_AMBIGUITY_2_ARGS | ( | Func | ) | RESOLVE_FLOAT_TO_TYPE_AMBIGUITY_2_ARGS(Func, bool) |
Definition at line 183 of file ResolveTypeAmbiguity.h.
#define RESOLVE_FLOAT_PREDICATE_AMBIGUITY_3_ARGS | ( | Func | ) | RESOLVE_FLOAT_TO_TYPE_AMBIGUITY_3_ARGS(Func, bool) |
Definition at line 184 of file ResolveTypeAmbiguity.h.
#define RESOLVE_FLOAT_TO_TYPE_AMBIGUITY_2_ARGS | ( | Func, | |
ReturnType ) MIX_FLOATS_TO_TYPE_2_ARGS(Func, ReturnType); |
Definition at line 176 of file ResolveTypeAmbiguity.h.
#define RESOLVE_FLOAT_TO_TYPE_AMBIGUITY_3_ARGS | ( | Func, | |
ReturnType ) MIX_FLOATS_TO_TYPE_3_ARGS(Func, ReturnType); |
Definition at line 179 of file ResolveTypeAmbiguity.h.