// tag
#expansion-statements
2 posts tagged #expansion-statements.
Naming a constant makes GCC stop believing it is one
A C++26 expansion statement over a compile-time range works on GCC 16.1 when the range is written inline and fails when the identical expression is given a name. The error says the constexpr variable is not a constant. Clang accepts both, and the workaround is to delete the name.
template for: iterating reflections at compile time
Expansion statements (proposal P1306) unroll a loop at compile time, instantiating the body once per element. They are the natural partner of reflection — one loop, N specialisations.