4 ms·
This doesn't require full dependent types because the values being examined are constants. Here's a version in C++20: https://gcc.godbolt.org/z/c9KqYb https:/
by comex 6y ago
This doesn't require full dependent types because the values being examined are constants. Here's a version in C++20:
https://gcc.godbolt.org/z/c9KqYb https://gcc.godbolt.org/z/c9KqYb
Unfortunately, this version requires a custom StringLiteral class and some other awkwardness because constexpr is still very limited. (I tried Rust const generics too but they're even worse.) This should improve in the future.
- laserharvest 6y agoConversely (I think), if you have dependent types you don’t require constexpr.