_Generic

_Generic is a macro from C standard in order to provide an interface for generic programming. The syntax is shown as below:

#define funcname(X)                       \
        _Generic(controlling_expression,  \
        type1: expression1,               \
        ...                               \
        typeN: expressionN)(X)

The expression could be variable or function (decay to 202202142131#). Therefore, depending on the type of X, it will find the most suitable expression for itself according to the result of controlling expression. The variables in controlling expression including the function parameters should not be qualified types (have identifier 202202111824#, 202202111830#, 202205171452#, 202205171504# and 202202081526#), array types and function types.

#metaprogramming #c #)