r/cpp • u/friedkeenan • Mar 08 '26
Exploring Mutable Consteval State in C++26
https://friedkeenan.github.io/posts/exploring-mutable-consteval-state/
83
Upvotes
r/cpp • u/friedkeenan • Mar 08 '26
View all comments
1
u/FlyingRhenquest Mar 08 '26
You can also accomplish that with std::views::iota for anything that has a size you can query at compile time. Like, say, an array of info objects.
Then in a function somewhere
I'm trying to avoid falling back to template metaprogramming and look for the Reflection approach, but I have had to fall back to metaprogramming a couple of times when "template for" wouldn't cooperate for whatever reason. They're still actively working on the feature and I'm finding that "template for" is working in places it was not a month ago, so I'll probably end up going back and rewriting some of my code once gcc16 is stable.