Change the compiler of c++ 11

Started by
22 comments, last by Radikalizm 11 years, 4 months ago

[quote name='noizex' timestamp='1354041989' post='5004608']
[quote name='BigDaveDev' timestamp='1353870914' post='5003980']
-snip -


FYI, Microsoft released CTP about a month ago (http://blogs.msdn.co...uture-of-c.aspx) that supports variadic templates and few more nice features of C++11. They haven't yet updated Intellisense so its a bit weird because you will get syntax error in some places but it will compile. I used it in my main project for a while and didn't encounter any errors.

It can be downloaded from here: http://www.microsoft...s.aspx?id=35515

I'm not sure when these changes will be incorporated into main version but lets hope it will be soon smile.png
[/quote]

Thanks! =D

Worth noting, though, that the standard library is NOT updated with this CTP. This means that the following won't work:

std::vector< int > my_ints = {1, 2, 3, 4, 5}; // won't compile

// Neither will this...
for(auto i: {1, 2, 3, 4, 5})
{
std::cout << i << ' ';
}


since that relies on library features... Still, getting closer!! At least now I can begin prep-ing my g++4.7 projects for MSVC a little at a time
[/quote]

Yeah they clearly stated that std containers were not updated, but will be for the final release. Its still worth it, just for variadic templates. I rewrote some crazy factory code that had like 200 lines of code + weird macro magic to support variable number of constructor parameters into something that takes one screen of clean code without any macros :)

Where are we and when are we and who are we?
How many people in how many places at how many times?
Advertisement
Why would you even want to do this? What's wrong with the MSVC compiler provided with VS2012?
One valid reason would be that C++11 support in MSVC (even CTP) is very meager compared to its competitors.

Though I somewhat agree with you insofar as C++98 already has a lot to swallow for a beginner, and seeing how hardly any project uses C++11 features, it is probably wise to learn a standard that "works" first. On the other hand C++11 is really a lot easier in many respects, so if you care mostly for your own projects, it may be a viable option to learn the "proper thing" right away.
After roughly two years of on/off use and a year of exclusively using what's supported in C++11, I can hardly imagine going back (at least voluntarily!) to a compiler or language version that doesn't have auto, lambda, delegating constructors, variadic templates, template typedefs, or range based loops. Some C++11 features may be debatable, but most of it is just... awesome.

There is no "codeblocks compiler", did you mean gcc? If so, it does not exist as such under Windows, but you can use MinGW which is a POSIX wrapper to run gcc on windows.
Allow me a small, admittedly pedantic, objection: There is a "Code::Blocks compiler" insofar as the convenience package that most people use is the one that has GCC-MinGW bundled. Or at least, this just looks like "the Code::Blocks compiler" to the casual observer.

Also, note that MinGW is very much not a POSIX wrapper. Cygwin is such a thing, but MinGW states that they explicitly try not to be Cygwin, but to provide a more or less minimal wrapper around MSVCRT.

Also, note that MinGW is very much not a POSIX wrapper. Cygwin is such a thing, but MinGW states that they explicitly try not to be Cygwin, but to provide a more or less minimal wrapper around MSVCRT.

Thanks, I believe I confused the two!

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”


One valid reason would be that C++11 support in MSVC (even CTP) is very meager compared to its competitors.

Though I somewhat agree with you insofar as C++98 already has a lot to swallow for a beginner, and seeing how hardly any project uses C++11 features, it is probably wise to learn a standard that "works" first. On the other hand C++11 is really a lot easier in many respects, so if you care mostly for your own projects, it may be a viable option to learn the "proper thing" right away.
After roughly two years of on/off use and a year of exclusively using what's supported in C++11, I can hardly imagine going back (at least voluntarily!) to a compiler or language version that doesn't have auto, lambda, delegating constructors, variadic templates, template typedefs, or range based loops. Some C++11 features may be debatable, but most of it is just... awesome.
VS2010 already had auto and lambda. VS2012 has range based loops (along with a big bunch of other stuff). The only missing thing I think would be important for a newbie is uniform initialization, and basic support for that is already in the update release (though to really make use of it, they still have to fix standard library containers to support it). You aren't giving up much by using the VS compiler anymore.

One valid reason would be that C++11 support in MSVC (even CTP) is very meager compared to its competitors.

Though I somewhat agree with you insofar as C++98 already has a lot to swallow for a beginner, and seeing how hardly any project uses C++11 features, it is probably wise to learn a standard that "works" first. On the other hand C++11 is really a lot easier in many respects, so if you care mostly for your own projects, it may be a viable option to learn the "proper thing" right away.
After roughly two years of on/off use and a year of exclusively using what's supported in C++11, I can hardly imagine going back (at least voluntarily!) to a compiler or language version that doesn't have auto, lambda, delegating constructors, variadic templates, template typedefs, or range based loops. Some C++11 features may be debatable, but most of it is just... awesome.


Agreed, C++ 11 is awesome and I've been using its features extensively as well. The lack of full C++11 support in VS2012 is frustrating at some times (especially when it comes to variadic templates) but it's not a deal-breaker to me.
The OP however is, if I remember correctly, a relatively young person who hasn't done any or at least not much programming at all. He will be writing very simple programs in the beginning and definitely won't be needing any 'fancy' C++11 features which aren't supported by VS2012 yet at all for quite some time.
Visual Studio is a good choice as a beginner IDE since it has a lot of features which can make a programmer's life a lot easier, so in my opinion it would be a much better idea for the OP to work in a more friendly environment while sacrificing some compiler features he won't be needing anytime soon, instead of letting him use an environment that's maybe worse for beginners just so he can have more C++11 support. Once he's at the point where he's comfortable with C++ and programming in general there will probably be an updated version of MSVC available with better C++11 support, or if that's not the case he will be comfortable enough with the language to switch compilers and IDEs without any trouble.

I gets all your texture budgets!

This topic is closed to new replies.

Advertisement