The following trivial code does not compile with GCC 4.9 and MSVC 2015:
struct A
{
static constexpr size_t GetTextureCount()
{
return 5;
}
static constexpr size_t a = GetTextureCount();
};
GCC 4.9 error: 'static constexpr size_t ISparkleRenderer::GetTextureCount()' called in a constant expression
MSVC 2015 error C2131: expression did not evaluate to a constant
Why this code does not compile? Probably I need higher compiler versions?