C++11

Everything about development and the OpenMW source code.
Post Reply
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

C++11

Post by Zini »

We are now finally changing to C++11. New code and changes to existing code can take advantage of the new standard. Please do not go around and change old code to C++11 just because you can (unless there are specific reasons).

Note that this is only C++11. We won't make the jump to C++14 yet. C++14 support is not spread widely enough among Linux distributions (especially LTS versions) and we absolutely do not want to require people to install a new compiler for working on OpenMW.

I will update this post as we move along further the C++ standard path.
User avatar
psi29a
Posts: 5355
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: C++11

Post by psi29a »

\o/ Yay!

Thanks everyone for reviewing and adding their suggestions/corrections/improvements. :)

Next step is to rebase my de-boosting branch now that we can replace many boost::* with their std::* equivalents. I've managed to cut down on compile times and still keep functionality intact.
User avatar
jvoisin
Posts: 303
Joined: 11 Aug 2011, 18:47
Contact:

Re: C++11

Post by jvoisin »

Hurray for de-boosting the code base ♥
User avatar
psi29a
Posts: 5355
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: C++11

Post by psi29a »

OK, my PR is ready for review.
https://github.com/OpenMW/openmw/pull/1314

It removes a lot of unnecessary includes which cuts down on the time needed to parse/check by the compiler.
It replaces boost::* with std:: equivalents where available.

It does not replace boost::math::gcd because stupid msvc doesn't support it until 2017.3 P2.
Had to add a few extra #include <algorithm> because std::min/max because MSVC2013 requires it. MSVC2014 does not.

We do not touch boost's fpath because of Scrawl's concern about utf-8 paths. This has yet to be validated. This would be a big win for us if we could use std:: instead. This will be for another PR.
TechNoirMK
Posts: 84
Joined: 19 Aug 2015, 15:58

Re: C++11

Post by TechNoirMK »

What does moving to C++11 mean, again?
raven
Posts: 66
Joined: 26 May 2016, 09:54

Re: C++11

Post by raven »

TechNoirMK wrote: 10 Jun 2017, 10:33 What does moving to C++11 mean, again?
As seen in the above posts, the std lib offers much more functionality, reduces external dependencies.

C++11 is overall a much nicer language to work with, has a lot of improvements in all areas: https://en.wikipedia.org/wiki/C%2B%2B11
Post Reply