Gamster Katalin Gamster Katalin - 11 months ago 66
C++ Question

C++11 constexpr compilation error

I am trying to declare a

and it throws compilation errors.

static constexpr float goBaseMovementSpeed = (1.135f / 440.f);

Why is this line not working?

error C2144: syntax error : 'float' should be preceded by ';'

error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

is a member of a class.

Compiler: Visual Studio 2013

Answer Source

Visual Studio 2013 does not support all the C++11 features. In the same time it supports tiny part of C++14 features like std::make_unique for example.

constexpr is not supported on Visual Studio 2013.

For the full list: