Re:How to implement a constant-expression counter in C++
by phaedrus on Monday May 11, 2015 @01:07PM
(#9526201)
I kind of hope they don't fix it. I could see this being as useful as the Boost Pre-processor Library. In fact I already know of a place where it would be useful. The Template Unit Test library requires (did require?) you to manually number your tests in sequence as template arguments. This const_expr counter could be used to not need to assign the numbers by hand.
In other words; if one sees this as a "bug" in the ISO C++ Standard, the "problem" is a lot deeper than friendly definitions (the technique used in the post).
C++ is a complex language, where many rules touch upon other, and with that it is not surprising that some rules can be bent to allow behavior which was perhaps never intended.
Future posts (probably after part 3) will address the philosophy of the "exploit", other techniques that boil down to doing the same thing, as well as proposed (ISO Standard) wording to "fix" the "problem" - if that is the path being walked.