Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkPPArgCount.h File Reference

Preprocessor utility macros for counting the number of variadic macro arguments at compile time. More...

Go to the source code of this file.

Macros

#define MITK_PP_ARG_COUNT(...)
 Count the number of arguments in a variadic macro invocation (1–25 arguments). More...
 
#define MITK_PP_ARG_COUNT_(tuple)
 Internal helper that unpacks the tuple for MITK_PP_ARG_N. More...
 
#define MITK_PP_ARG_N(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, N, ...)
 Internal helper that selects the Nth argument to determine the count. More...
 
#define MITK_PP_RSEQ_N()
 Internal reverse integer sequence used by MITK_PP_ARG_COUNT to resolve the argument count. More...
 

Detailed Description

Preprocessor utility macros for counting the number of variadic macro arguments at compile time.

Provides the MITK_PP_ARG_COUNT macro, which expands to the number of arguments passed to it (supports 1 to 25 arguments). This is used internally by the AccessByItk macro family.

Definition in file mitkPPArgCount.h.

Macro Definition Documentation

◆ MITK_PP_ARG_COUNT

#define MITK_PP_ARG_COUNT (   ...)

Count the number of arguments in a variadic macro invocation (1–25 arguments).

Example: MITK_PP_ARG_COUNT(a, b, c) expands to 3.

Definition at line 31 of file mitkPPArgCount.h.

◆ MITK_PP_ARG_COUNT_

#define MITK_PP_ARG_COUNT_ (   tuple)

Internal helper that unpacks the tuple for MITK_PP_ARG_N.

Definition at line 34 of file mitkPPArgCount.h.

◆ MITK_PP_ARG_N

#define MITK_PP_ARG_N (   _1,
  _2,
  _3,
  _4,
  _5,
  _6,
  _7,
  _8,
  _9,
  _10,
  _11,
  _12,
  _13,
  _14,
  _15,
  _16,
  _17,
  _18,
  _19,
  _20,
  _21,
  _22,
  _23,
  _24,
  _25,
  N,
  ... 
)

Internal helper that selects the Nth argument to determine the count.

Definition at line 37 of file mitkPPArgCount.h.

◆ MITK_PP_RSEQ_N

#define MITK_PP_RSEQ_N ( )

Internal reverse integer sequence used by MITK_PP_ARG_COUNT to resolve the argument count.

Definition at line 67 of file mitkPPArgCount.h.