почему массив const недоступен из функции constexpr?
у меня есть функция constexpr с именем access, и я хочу получить доступ к одному элементу из массива:
char const*const foo="foo";
char const*const bar[10]={"bar"};
constexpr int access(char const* c) { return (foo == c); } // this is working
constexpr int access(char const* c) { return (bar[0] == c); } // this isn't
int access(char const* c) { return (bar[0] == c); } // this is also working
я получаю ошибку:
error: the value of 'al' is not usable in a constant expression
почему я не могу получить доступ к одному из элементов доступа? или лучше как мне это сделать, если это вообще возможно?