P99

◆ P99_DESIGNATED

#define P99_DESIGNATED (   VAR,
  ... 
)    { P00_DESIGNATED(VAR, P99_NARG(__VA_ARGS__), __VA_ARGS__) }

Construct a designated initializer by copying fields of VAR.

The argument list must be composed of designators, something like

struct toto { int a; int b; } A = { .a = 9, .b = 7 };
struct toto B = P99_DESIGNATED(A, .b);
double C[4] = { 1, 2, 3, 4 };
double D[4] = P99_DESIGNATED(C, [0], [2]);

So here B.b is initialized with the value of A.b and B.a, since .a is not in the list, is initialized by 0. Likewise D gets copies of C[0] and C[2] and the other fields are initialized to 0.

See also
P99_LCOPY
Warning
argument 0 may be evaluated multiple times
Remarks
argument 1 must be a field designator
argument 2 must be a field designator
argument 3 must be a field designator

Definition at line 253 of file p99_map.h.

P99_DESIGNATED
#define P99_DESIGNATED(VAR,...)
Construct a designated initializer by copying fields of VAR.
Definition: p99_map.h:253