This code does not compile in Visual Studio 2013
template <typename X>
constexpr //error C2144: syntax error : 'bool' should be preceded by ';'
bool Test(X x)
{
return true;
}
However, if I remove the constexpr keyword, it does compile.
But constexpr shouldn't be a problem? since it always returns true.
What went wrong?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With