Is it possible to declare a variable extern constexpr and define it in another file?
I tried it but the compiler gives error:
De
What you probably want is extern and constexpr initialization, e.g.:
// in header
extern const int g_n;
// in cpp
constexpr int g_n = 2;
This is support though in Visual Studio 2017 only through conformance mode: