eĿlipsis
a language independent preprocessor
 
Loading...
Searching...
No Matches
ellipsis-recursive.dirs File Reference

Define a recursive macro RECURSIVE_NAME More...

Macros

#define RECURSIVE(...)
 The recursive call of the macro RECURSIVE_NAME.
 
#define RECURSIVE_BODY
 The body of the macro RECURSIVE_NAME.
 
#define RECURSIVE_NAME
 The name that is to be defined.
 
#define RECURSIVE_PARAMETERS
 The list of parameters for RECURSIVE_NAME.
 

Detailed Description

Define a recursive macro RECURSIVE_NAME

This needs three macros to be defined: RECURSIVE_NAME, RECURSIVE_PARAMETERS and RECURSIVE_BODY, and will typically use the macro RECURSIVE to call itself.

The following shows an example how ELLIPSIS_SUM could be defined.

#include_directives 〈ellipsis-recursive.dirs〉 \
__prefix__(bind RECURSIVE_NAME ELLIPSIS_SUM) \
__prefix__(bind RECURSIVE_PARAMETERS _0, ...) \
__prefix__(bind RECURSIVE_BODY (_0)__VA_OPT__(+RECURSIVE(__VA_ARGS__)))

Macro Definition Documentation

◆ RECURSIVE

#define RECURSIVE (   ...)

The recursive call of the macro RECURSIVE_NAME.

This behaves as if it were defined as accepting arguments as given in RECURSIVE_PARAMETERS and expands to RECURSIVE_BODY.

Warning
To be sure that the recursion is finite you should only invoke RECURSIVE with at least one argument less that you received.

◆ RECURSIVE_BODY

#define RECURSIVE_BODY

The body of the macro RECURSIVE_NAME.

Here the name RECURSIVE may be used to call the macro recursively.

Warning
To be sure that the recursion is finite you should only invoke RECURSIVE with at least one argument less that you received.

◆ RECURSIVE_NAME

#define RECURSIVE_NAME

The name that is to be defined.

This will be defined as a functional macro with a parameter list as in RECURSIVE_PARAMETERS.

◆ RECURSIVE_PARAMETERS

#define RECURSIVE_PARAMETERS

The list of parameters for RECURSIVE_NAME.

This should have at least one named argument and should terminate with a ... such as in

A, B, ...