Page 1 of 1
C++11
Posted: Tue Oct 29, 2013 2:35 am
by robn
I've just enabled C++11 for the release builds, so you're now free to include C++11 constructs in your code. Don't go overboard, of course - right tool for the job and all that!
I haven't updated any of the MSVC projects. They'll probably keep working for the moment because nothing has actually changed.
#2493 uses "auto", and will probably be first to land. That'll likely break 2008. Anything more than the simple stuff will probably break 2010. We'll find out as we go, as usual.
Re: C++11
Posted: Wed Nov 27, 2013 6:59 pm
by FluffyFreak
"final" keyword on class declaration breaks Visual Studio 2010.
Just had to comment the two instances of it out to do a build for Core to track down his crashing problem.
Re: C++11
Posted: Wed Nov 27, 2013 7:38 pm
by jpab
Ok. In the relevant issue (
#2330), we said we'd support VC2012+. However, VC2012 and up don't run on Windows XP, so I'm inclined to say we should continue to support VC2010 until we get the Code::Blocks build working, as long as that support isn't too onerous.
My vote would be to hide the difference with a #define in libs.h. I think this is ok for 'final', because apart from possibly exposing some (rare) optimisation opportunities, final just makes the compiler complain if you inherit from the class. It doesn't imply any difference in behaviour that I'm aware of, so just skipping the keyword shouldn't break anything. The only danger is someone using VC2010 accidentally inheriting from a 'final' class and not noticing, and we'll pick that up quickly enough when someone with a real compiler builds the code.
Code: Select all
#if !defined(_MSC_VER) || (_MSC_VER > 1600)
#define CLASS_FINAL final
#else
#define CLASS_FINAL
#endif
Re: C++11
Posted: Wed Nov 27, 2013 7:47 pm
by FluffyFreak
Sounds good to me, I didn't suggest that kind of fix as I thought we were - quite rightly - trying to avoid them :)
I'd love to help getting the Code::Blocks build up and running but I'm just snowed under right now :(