VC 2013 does not support all C++11 features yet. Look at MSDN list.
Why can constexpr not apply to constructors?
-
13-10-2022 - |
Question
Why can constexpr not apply to constructors?
The following code cannot be compiled with VC++ 2013 CTP.
struct A
{
constexpr A()
: _n(5)
{}
int _n;
};
constexpr A f()
{
return A();
}
int main()
{
auto a = f();
}
error C3757: 'A': type not allowed for 'constexpr' function
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow