Add to your cpp file:
constexpr char foo::baz[];
Reason: You have to provide the definition of the static member as well as the declaration. The declaration and the initializer go inside the class definition, but the member definition has to be separate.
More Related Contents:
- Why does constexpr static member (of type class) require a definition?
- What am I allowed to do with a static, constexpr, in-class initialized data member?
- What’s the difference between constexpr and const?
- When does a constexpr function get evaluated at compile time?
- Why do constant expressions have an exclusion for undefined behavior?
- When should you use constexpr capability in C++11?
- Is is_constexpr possible in C++11?
- constexpr and initialization of a static const void pointer with reinterpret cast, which compiler is right?
- C++11 – static_assert within constexpr function?
- Why do we need to mark functions as constexpr?
- Is constexpr supported with lambda functions / expressions?
- Does constexpr imply inline?
- constexpr overloading
- static constexpr member of same type as class being defined
- C++11 constexpr function pass parameter
- Does static constexpr variable inside a function make sense?
- Constexpr pointer value
- constexpr initializing static member using static function
- Static constexpr odr-used or not?
- Is it possible to declare constexpr class in a header and define it in a separate .cpp file?
- constexpr function parameters as template arguments
- Lookup table with constexpr
- Is a constexpr array necessarily odr-used when subscripted?
- constexpr const vs constexpr variables?
- `static constexpr` function called in a constant expression is…an error?
- Why can I call a non-constexpr function inside a constexpr function?
- constexpr initialization of array to sort contents
- C++ Linker Error With Class static constexpr
- Why is reinterpret_cast not constexpr?
- Is constexpr really needed?