What I said in this comment was that you cannot have something like
template <int N> int f(); constexpr int g(int i) { return f<i>();
because although the result of the constexpr function can be a constant expression, its parameters are absent inside the body. The constexpr function can be called with a constant or with inconsistent arguments, the caller gets the solution, and C ++ does not have any function that can only be called with constant arguments.
This mattered in the answer you read, because it would be useful to have a function argument const char (&str)[N] and consider str[i] as a constant expression inside the body of the function.
It doesn’t matter for the code you have. This code is ok.
hvd source share