On Sun, 17 Nov 2024 at 11:05, David Laight <David.Laight@xxxxxxxxxx> wrote: > > I think everything can be built on a base if_const_zero(x, if_z, if_nz) > #define const_true(x) if_const_zero(!(x), 1, 0) > #define is_constexpr(x) if_const_zero((x) * 0), 1, 0) > which gives a bit more flexibility. The is_constexpr() should probably be if_const_zero(0*!(x)),1,0) to be ok with pointers and with "long long" constants. And the "1,0" arguments should have a real reason for existing. I'm not entirely convinced any other cases make much sense. Linus