MCRO
C++23 utilities for Unreal Engine.
Loading...
Searching...
No Matches
Macros.h File Reference
#include "CoreMinimal.h"
#include "HAL/PreprocessorHelpers.h"
#include "boost/preprocessor.hpp"
#include "Misc/EngineVersionComparison.h"

Go to the source code of this file.

Macros

#define PREPROCESSOR_TO_TEXT(x)
 
#define MACRO_OVERLOAD(prefix, ...)
 Implement preprocessor function overloading based on argument count for a set of macros following a distinct convention. Individual overloads must have a trailing number corresponding to the number of arguments they accept.
 
#define DEFAULT_ON_EMPTY(value, default)
 Returns given default value when input value is empty.
 
#define MCRO_FORWARD_FUNCTION   Forward
 
#define FWD(...)
 Shorten forwarding expression with this macro so one may not need to specify explicit type.
 

Detailed Description

Author
David Mórász
Date
2025

Definition in file Macros.h.

Macro Definition Documentation

◆ DEFAULT_ON_EMPTY

#define DEFAULT_ON_EMPTY ( value,
default )
Value:
BOOST_PP_IF(BOOST_PP_CHECK_EMPTY(value), default, value)

Returns given default value when input value is empty.

Definition at line 74 of file Macros.h.

◆ FWD

#define FWD ( ...)
Value:
#define MCRO_FORWARD_FUNCTION
Definition Macros.h:95

Shorten forwarding expression with this macro so one may not need to specify explicit type.

Definition at line 100 of file Macros.h.

◆ MACRO_OVERLOAD

#define MACRO_OVERLOAD ( prefix,
... )
Value:
PREPROCESSOR_APPEND_VA_ARG_COUNT(prefix, __VA_ARGS__)(__VA_ARGS__)

Implement preprocessor function overloading based on argument count for a set of macros following a distinct convention. Individual overloads must have a trailing number corresponding to the number of arguments they accept.

For example:

#define FOO_3(a, b, c) a##b##c
#define FOO_2(a, b) a##b
#define FOO_1(a) a
#define FOO(...) MACRO_OVERLOAD(FOO_, __VA_ARGS__)
FOO(1) // -> 1
FOO(1, 2) // -> 12
FOO(1, 2, 3) // -> 123

Definition at line 71 of file Macros.h.

◆ MCRO_FORWARD_FUNCTION

#define MCRO_FORWARD_FUNCTION   Forward

Definition at line 95 of file Macros.h.

◆ PREPROCESSOR_TO_TEXT

#define PREPROCESSOR_TO_TEXT ( x)
Value:
TEXT(PREPROCESSOR_TO_STRING(x))

Definition at line 51 of file Macros.h.