Microsoft Visual Studio 2015 marks as an error

Hi,

What did not trigger an error in Xcode 7.2, triggers the following error in Visual Studio 2015, update 1 :

"'constexpr' is not valid here"


the apparent offending code is:

template<typename T>
constexpr T pi = T(3.14159);

which should be a constant expression unless this is a not yet supported issue regarding template variables in MSVC

BTW, if I remove constexpr, it compiles correctly... A question: how does one use a template variable? I am thinking that maybe that variable is not being instantiated...

Thanks
Juan
Last edited on
Template variables are not yet supported in VC++.
thanks!!
This type of tamplate is not supported by Visual c++ .
you can read more on Microsoft website.
Gustavo Woltmann
Is this GustWoltmann the same troll with a slightly different name, doing the same thing - trying get the post count up ?
I actually don't know. For the past week and half I've started to see a bunch of shit/troll comments from completely new users, although what they are saying in the comment is somewhat relevant to @OPs post... Not sure what that's all about.

Edit: Note that these comments Im talking about are always late to posts and come after @OPs question has already been answered.
Last edited on
The other user:

http://www.cplusplus.com/user/Gustavo_Woltmann/


The methods of trolls are wide and varied, a couple of years ago someone actually admitted to having 100 odd user names to troll with, so I wouldn't be surprised if all this was one person.
Topic archived. No new replies allowed.