Why is the Visual Studio Community 2017 C++ standard C++98?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
24
down vote

favorite
1












Yesterday I upgraded to the latest VS Community 2017 (the previous one was installed last year) and wanted to check the C++ standard. So I run the following code that checks it, and as it turns out, I have C++98:



#include<iostream>
using namespace std;
int main()

cout << __cplusplus << endl;
system("pause");



Which outputs




199711




Why don't I have the latest C++ standard?



screenshot of the code, output and vs version










share|improve this question























  • Try changing the related project properties.
    – Ï€Î¬Î½Ï„α ῥεῖ
    15 hours ago










  • Possible duplicate: Is C++11 available in Visual Studio 2017?
    – Ï€Î¬Î½Ï„α ῥεῖ
    15 hours ago






  • 2




    You should build with /std:c++17 and /permissive- for example.
    – VTT
    15 hours ago







  • 1




    Don't trust __cplusplus. VS2017 supports C++17 just fine - you just need to pass the correct commandline option(s) to enable it.
    – Jesper Juhl
    12 hours ago






  • 5




    Possible duplicate of Visual Studio 2012 __cplusplus and C++ 11
    – user202729
    12 hours ago














up vote
24
down vote

favorite
1












Yesterday I upgraded to the latest VS Community 2017 (the previous one was installed last year) and wanted to check the C++ standard. So I run the following code that checks it, and as it turns out, I have C++98:



#include<iostream>
using namespace std;
int main()

cout << __cplusplus << endl;
system("pause");



Which outputs




199711




Why don't I have the latest C++ standard?



screenshot of the code, output and vs version










share|improve this question























  • Try changing the related project properties.
    – Ï€Î¬Î½Ï„α ῥεῖ
    15 hours ago










  • Possible duplicate: Is C++11 available in Visual Studio 2017?
    – Ï€Î¬Î½Ï„α ῥεῖ
    15 hours ago






  • 2




    You should build with /std:c++17 and /permissive- for example.
    – VTT
    15 hours ago







  • 1




    Don't trust __cplusplus. VS2017 supports C++17 just fine - you just need to pass the correct commandline option(s) to enable it.
    – Jesper Juhl
    12 hours ago






  • 5




    Possible duplicate of Visual Studio 2012 __cplusplus and C++ 11
    – user202729
    12 hours ago












up vote
24
down vote

favorite
1









up vote
24
down vote

favorite
1






1





Yesterday I upgraded to the latest VS Community 2017 (the previous one was installed last year) and wanted to check the C++ standard. So I run the following code that checks it, and as it turns out, I have C++98:



#include<iostream>
using namespace std;
int main()

cout << __cplusplus << endl;
system("pause");



Which outputs




199711




Why don't I have the latest C++ standard?



screenshot of the code, output and vs version










share|improve this question















Yesterday I upgraded to the latest VS Community 2017 (the previous one was installed last year) and wanted to check the C++ standard. So I run the following code that checks it, and as it turns out, I have C++98:



#include<iostream>
using namespace std;
int main()

cout << __cplusplus << endl;
system("pause");



Which outputs




199711




Why don't I have the latest C++ standard?



screenshot of the code, output and vs version







c++ visual-studio standards






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 13 mins ago









Boann

35.7k1184116




35.7k1184116










asked 15 hours ago









eagleye

1441210




1441210











  • Try changing the related project properties.
    – Ï€Î¬Î½Ï„α ῥεῖ
    15 hours ago










  • Possible duplicate: Is C++11 available in Visual Studio 2017?
    – Ï€Î¬Î½Ï„α ῥεῖ
    15 hours ago






  • 2




    You should build with /std:c++17 and /permissive- for example.
    – VTT
    15 hours ago







  • 1




    Don't trust __cplusplus. VS2017 supports C++17 just fine - you just need to pass the correct commandline option(s) to enable it.
    – Jesper Juhl
    12 hours ago






  • 5




    Possible duplicate of Visual Studio 2012 __cplusplus and C++ 11
    – user202729
    12 hours ago
















  • Try changing the related project properties.
    – Ï€Î¬Î½Ï„α ῥεῖ
    15 hours ago










  • Possible duplicate: Is C++11 available in Visual Studio 2017?
    – Ï€Î¬Î½Ï„α ῥεῖ
    15 hours ago






  • 2




    You should build with /std:c++17 and /permissive- for example.
    – VTT
    15 hours ago







  • 1




    Don't trust __cplusplus. VS2017 supports C++17 just fine - you just need to pass the correct commandline option(s) to enable it.
    – Jesper Juhl
    12 hours ago






  • 5




    Possible duplicate of Visual Studio 2012 __cplusplus and C++ 11
    – user202729
    12 hours ago















Try changing the related project properties.
– Ï€Î¬Î½Ï„α ῥεῖ
15 hours ago




Try changing the related project properties.
– Ï€Î¬Î½Ï„α ῥεῖ
15 hours ago












Possible duplicate: Is C++11 available in Visual Studio 2017?
– Ï€Î¬Î½Ï„α ῥεῖ
15 hours ago




Possible duplicate: Is C++11 available in Visual Studio 2017?
– Ï€Î¬Î½Ï„α ῥεῖ
15 hours ago




2




2




You should build with /std:c++17 and /permissive- for example.
– VTT
15 hours ago





You should build with /std:c++17 and /permissive- for example.
– VTT
15 hours ago





1




1




Don't trust __cplusplus. VS2017 supports C++17 just fine - you just need to pass the correct commandline option(s) to enable it.
– Jesper Juhl
12 hours ago




Don't trust __cplusplus. VS2017 supports C++17 just fine - you just need to pass the correct commandline option(s) to enable it.
– Jesper Juhl
12 hours ago




5




5




Possible duplicate of Visual Studio 2012 __cplusplus and C++ 11
– user202729
12 hours ago




Possible duplicate of Visual Studio 2012 __cplusplus and C++ 11
– user202729
12 hours ago












1 Answer
1






active

oldest

votes

















up vote
31
down vote



accepted










The value of __cplusplus is temporarily intentionally non-conformant by default for current versions of Visual Studio in order to avoid breaking existing code. It does not mean your compiler does not support any C++11 (or newer) features.



Quoting from MSVC now correctly reports __cplusplus:




/Zc:__cplusplus



You need to compile with the /Zc:__cplusplus switch to see the updated value of the __cplusplus macro. We tried updating the macro by default and discovered that a lot of code doesn’t compile correctly when we change the value of __cplusplus. We’ll continue to require use of the /Zc:__cplusplus switch for all minor versions of MSVC in the 19.xx family.







share|improve this answer




















  • success! I followed the instructions on setting /Zc:__cplusplus to enabled and I see I have c++14 (201402). This is the guide for doing this: docs.microsoft.com/en-us/cpp/build/reference/…
    – eagleye
    14 hours ago







  • 3




    If the actual standard the compiler is enforcing is the focus of concern, rather than the value of that macro, you can right click on your Project in the Solution Explorer. and Select Properties. Then expand the C/C++ menu on the left, and choose the Language submenu. There you can choose ++14,++17, or ++latest.
    – schulmaster
    3 hours ago











Your Answer





StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52465524%2fwhy-is-the-visual-studio-community-2017-c-standard-c98%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
31
down vote



accepted










The value of __cplusplus is temporarily intentionally non-conformant by default for current versions of Visual Studio in order to avoid breaking existing code. It does not mean your compiler does not support any C++11 (or newer) features.



Quoting from MSVC now correctly reports __cplusplus:




/Zc:__cplusplus



You need to compile with the /Zc:__cplusplus switch to see the updated value of the __cplusplus macro. We tried updating the macro by default and discovered that a lot of code doesn’t compile correctly when we change the value of __cplusplus. We’ll continue to require use of the /Zc:__cplusplus switch for all minor versions of MSVC in the 19.xx family.







share|improve this answer




















  • success! I followed the instructions on setting /Zc:__cplusplus to enabled and I see I have c++14 (201402). This is the guide for doing this: docs.microsoft.com/en-us/cpp/build/reference/…
    – eagleye
    14 hours ago







  • 3




    If the actual standard the compiler is enforcing is the focus of concern, rather than the value of that macro, you can right click on your Project in the Solution Explorer. and Select Properties. Then expand the C/C++ menu on the left, and choose the Language submenu. There you can choose ++14,++17, or ++latest.
    – schulmaster
    3 hours ago















up vote
31
down vote



accepted










The value of __cplusplus is temporarily intentionally non-conformant by default for current versions of Visual Studio in order to avoid breaking existing code. It does not mean your compiler does not support any C++11 (or newer) features.



Quoting from MSVC now correctly reports __cplusplus:




/Zc:__cplusplus



You need to compile with the /Zc:__cplusplus switch to see the updated value of the __cplusplus macro. We tried updating the macro by default and discovered that a lot of code doesn’t compile correctly when we change the value of __cplusplus. We’ll continue to require use of the /Zc:__cplusplus switch for all minor versions of MSVC in the 19.xx family.







share|improve this answer




















  • success! I followed the instructions on setting /Zc:__cplusplus to enabled and I see I have c++14 (201402). This is the guide for doing this: docs.microsoft.com/en-us/cpp/build/reference/…
    – eagleye
    14 hours ago







  • 3




    If the actual standard the compiler is enforcing is the focus of concern, rather than the value of that macro, you can right click on your Project in the Solution Explorer. and Select Properties. Then expand the C/C++ menu on the left, and choose the Language submenu. There you can choose ++14,++17, or ++latest.
    – schulmaster
    3 hours ago













up vote
31
down vote



accepted







up vote
31
down vote



accepted






The value of __cplusplus is temporarily intentionally non-conformant by default for current versions of Visual Studio in order to avoid breaking existing code. It does not mean your compiler does not support any C++11 (or newer) features.



Quoting from MSVC now correctly reports __cplusplus:




/Zc:__cplusplus



You need to compile with the /Zc:__cplusplus switch to see the updated value of the __cplusplus macro. We tried updating the macro by default and discovered that a lot of code doesn’t compile correctly when we change the value of __cplusplus. We’ll continue to require use of the /Zc:__cplusplus switch for all minor versions of MSVC in the 19.xx family.







share|improve this answer












The value of __cplusplus is temporarily intentionally non-conformant by default for current versions of Visual Studio in order to avoid breaking existing code. It does not mean your compiler does not support any C++11 (or newer) features.



Quoting from MSVC now correctly reports __cplusplus:




/Zc:__cplusplus



You need to compile with the /Zc:__cplusplus switch to see the updated value of the __cplusplus macro. We tried updating the macro by default and discovered that a lot of code doesn’t compile correctly when we change the value of __cplusplus. We’ll continue to require use of the /Zc:__cplusplus switch for all minor versions of MSVC in the 19.xx family.








share|improve this answer












share|improve this answer



share|improve this answer










answered 15 hours ago









hvd

113k11194272




113k11194272











  • success! I followed the instructions on setting /Zc:__cplusplus to enabled and I see I have c++14 (201402). This is the guide for doing this: docs.microsoft.com/en-us/cpp/build/reference/…
    – eagleye
    14 hours ago







  • 3




    If the actual standard the compiler is enforcing is the focus of concern, rather than the value of that macro, you can right click on your Project in the Solution Explorer. and Select Properties. Then expand the C/C++ menu on the left, and choose the Language submenu. There you can choose ++14,++17, or ++latest.
    – schulmaster
    3 hours ago

















  • success! I followed the instructions on setting /Zc:__cplusplus to enabled and I see I have c++14 (201402). This is the guide for doing this: docs.microsoft.com/en-us/cpp/build/reference/…
    – eagleye
    14 hours ago







  • 3




    If the actual standard the compiler is enforcing is the focus of concern, rather than the value of that macro, you can right click on your Project in the Solution Explorer. and Select Properties. Then expand the C/C++ menu on the left, and choose the Language submenu. There you can choose ++14,++17, or ++latest.
    – schulmaster
    3 hours ago
















success! I followed the instructions on setting /Zc:__cplusplus to enabled and I see I have c++14 (201402). This is the guide for doing this: docs.microsoft.com/en-us/cpp/build/reference/…
– eagleye
14 hours ago





success! I followed the instructions on setting /Zc:__cplusplus to enabled and I see I have c++14 (201402). This is the guide for doing this: docs.microsoft.com/en-us/cpp/build/reference/…
– eagleye
14 hours ago





3




3




If the actual standard the compiler is enforcing is the focus of concern, rather than the value of that macro, you can right click on your Project in the Solution Explorer. and Select Properties. Then expand the C/C++ menu on the left, and choose the Language submenu. There you can choose ++14,++17, or ++latest.
– schulmaster
3 hours ago





If the actual standard the compiler is enforcing is the focus of concern, rather than the value of that macro, you can right click on your Project in the Solution Explorer. and Select Properties. Then expand the C/C++ menu on the left, and choose the Language submenu. There you can choose ++14,++17, or ++latest.
– schulmaster
3 hours ago


















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52465524%2fwhy-is-the-visual-studio-community-2017-c-standard-c98%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

Long meetings (6-7 hours a day): Being “babysat” by supervisor

What does second last employer means? [closed]

One-line joke