C++11

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

C++11

Post by Zini » 09 Jun 2017, 17:01

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: 3432
Joined: 29 Sep 2011, 10:13
Github profile: https://github.com/psi29a/
Contact:

Re: C++11

Post by psi29a » 09 Jun 2017, 17:39

\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
ap0
Posts: 246
Joined: 11 Aug 2011, 18:47
Location: France
Contact:

Re: C++11

Post by ap0 » 09 Jun 2017, 18:28

Hurray for de-boosting the code base ♥

User avatar
psi29a
Posts: 3432
Joined: 29 Sep 2011, 10:13
Github profile: https://github.com/psi29a/
Contact:

Re: C++11

Post by psi29a » 10 Jun 2017, 08:51

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: 80
Joined: 19 Aug 2015, 15:58

Re: C++11

Post by TechNoirMK » 10 Jun 2017, 10:33

What does moving to C++11 mean, again?

raven
Posts: 47
Joined: 26 May 2016, 09:54

Re: C++11

Post by raven » 10 Jun 2017, 12:56

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

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests