Constexpr Not Compiling in Vc2013

constexpr not compiling in VC2013

Microsoft publishes a C++11 compatibility table, under which constexpr is clearly marked as not being available in Visual Studio 2013.

The November 2013 CTP has it, though.

Source: Google visual studio constexpr

Why does adding constexpr make VS2013 reject this?

Despite the 2013 in the name, VS2013 does not purport to be a compiler targeting the C++11 standard (which was when constexpr was introduced).

The value of __cplusplus will be 201103L for a C++11 compiler.

So your compiler encounters a token it does not recognise, and issues a diagnostic.

constexpr static std::arrayconst char *,5 failing to compile with MSVC2013

As per this microsoft devblog, constexpr is one of the C++11 core language features that is not supported in VS 2013. And it is only partially supported in "Nov 2013 CTP."

C++11 constexpr compilation error

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:
https://msdn.microsoft.com/en-us/library/hh567368.aspx

Why I am getting this error: constexpr' is not valid here

Non-static data members cannot be declared as constexpr. Use

class myClass
{
static constexpr int x = 4;
};

instead.



Related Topics



Leave a reply



Submit