How to use an array-literal with _Static_assert in C?

74 Views Asked by At

I want to use an array-literal of literals in a _Static_assert, but I get a compiler error saying this is not a constant expression

_Static_assert((int[]){2, 1, 0}[2], "err");

Is there a way to make it work?

0

There are 0 best solutions below