3 ms·
Oh, cool, direct links to the relevant papers! It's not always easy to find the relevant stuff in C++ land. Thanks a lot! I have to read this stuff first, bu
by still_grokking 4y ago
Oh, cool, direct links to the relevant papers!
It's not always easy to find the relevant stuff in C++ land.
Thanks a lot!
I have to read this stuff first, but my gut feeling would still be that `constexpr` and such isn't reflection at all.
The `sizeof` example seems more in this direction (because some expression gets actually inspected).
- jcelerier 4y agoi'm talking about "if constexpr", not "constexpr" ; "if constexpr" allows to make choices at compile time depending on properties of a variable and that is definitely what reflection is about. e.g. void f(auto x) { // common code path if constexpr(x is floating-point) { // code path 1 } else if constexpr(x is a string) { // code path 2 } // common code path }
- still_grokking 4y agoOh, I see. You're right. Thanks for the pointer.