Closed osimola closed 8 years ago
Thanks! However I'm wondering which version of clang you are using? Because constexpr should be allowed here and it would ensure that this lookup table would really be optimized as compile time constant. It worked for me (with Clang 3.7).
You are right, constexpr works here. The problem was single braces around initializer list which somehow caused another error message about constexpr.
I have Clang 3.4 on Linux and Apple LLVM 7.0.2 on Mac, no idea which upstream LLVM version the latter is based on.
UPDATE: Clang 3.4 is fine with single braces around std::array initializer list. XCode Clang does not understand single braces and complains about constexpr if there is constexpr and single braces.