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
How to Export Templated Classes from a Dll Without Explicit Specification
C++ Short-Circuiting of Booleans
Can Class Template Constructors Have a Redundant Template Parameter List in C++20
How Does _Builtin_Clear_Cache Work
How to Solve the Error Lnk2019: Unresolved External Symbol - Function
How to Output the Value of an Enum Class in C++11
Why How to Use 'Std::Move' on a 'Const' Object
Matlab VS C++ Double Precision
Link Errors Using <Filesystem> Members in C++17
How to Truncate a File While It Is Open with Fstream
Class & Function Names Highlighting in Vim
Equivalent C++ to Python Generator Pattern
Building Qt5 with Visual Studio 2012/Visual Studio 2013, and Integrating with the Ide
At^Sysinfo and a C++ Terminal Program
Cycles in Family Tree Software
Get Index of Qpushbutton on 2D Array Qpushbutton