C++26: Std:Constant_wrapper
Comments
Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules
Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules
Summary
C++26's std::constant_wrapper (with the std::cw<V> shorthand), proposed in P2781R9 by Dusíková, Kretz, and Laine and refined in P3978R3, wraps any structural value as a non-type template parameter so it stays a compile-time constant across function calls.