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.
C++11
- psi29a
- Posts: 5361
- Joined: 29 Sep 2011, 10:13
- Location: Belgium
- Gitlab profile: https://gitlab.com/psi29a/
- Contact:
Re: C++11
\o/ Yay!
Thanks everyone for reviewing and adding their suggestions/corrections/improvements.![Smile :)](./images/smilies/icon_e_smile.gif)
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.
Thanks everyone for reviewing and adding their suggestions/corrections/improvements.
![Smile :)](./images/smilies/icon_e_smile.gif)
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.
Re: C++11
Hurray for de-boosting the code base ♥
- psi29a
- Posts: 5361
- Joined: 29 Sep 2011, 10:13
- Location: Belgium
- Gitlab profile: https://gitlab.com/psi29a/
- Contact:
Re: C++11
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.
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.
-
- Posts: 84
- Joined: 19 Aug 2015, 15:58
Re: C++11
What does moving to C++11 mean, again?
Re: C++11
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