Jump to content

  • Log In with Google      Sign In   
  • Create Account

Change the compiler of c++ 11


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
24 replies to this topic

#21 noizex   Members   -  Reputation: 882

Like
0Likes
Like

Posted 28 November 2012 - 04:36 AM



-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 Posted Image


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


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 :)

Sponsor:

#22 samoth   Crossbones+   -  Reputation: 5032

Like
2Likes
Like

Posted 28 November 2012 - 05:22 AM

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.

#23 Bacterius   Crossbones+   -  Reputation: 9267

Like
0Likes
Like

Posted 28 November 2012 - 05:29 AM

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!

The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis


#24 Yrjö P.   Crossbones+   -  Reputation: 1412

Like
0Likes
Like

Posted 28 November 2012 - 05:47 AM

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.

#25 Radikalizm   Crossbones+   -  Reputation: 2975

Like
0Likes
Like

Posted 28 November 2012 - 07:00 AM

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!





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS