C++11
Posted: Sat Mar 26, 2016 3:29 pm
I tried to search the forums for this topic, but C++11 is too short of a search term.
The question is.
Are we interested in starting to use C++11 features?
The more leading question is.
When will we be interested in using C++11 features?
I am bringing up this topic, mostly because I want to use the type inference of auto and the
automatic iteration of the new for loops.
Obviously, if the minimum versions of the compilers that we support do not support any features
of C++11 then this is a non-starter.
I think that the OSs/compilers that we are supporting are Apple/Clang(XCode), Linux/GCC, and Windows/MSVC.
I don't know what minimum versions of those compilers that we support.
The linked table shows C++ support in various compilers by version.
All C++11 features are supported by Clang 3.3, GCC 4.8.1 and MSVC 14.0.
Most features are supported by Clang 3.1, GCC 4.6, and MSVC 12.0.
Current compilers versions are Clang 3.8, GCC 5.3, and MSVC 14.0.
http://en.cppreference.com/w/cpp/compiler_support
C++11 features can simplify code for reading, improve performance and increase robustness.
The auto keyword, constexpr, ranged-for loop and initializer lists
all trivially improve readability and ease of writing.
Lambda expression can reduce verbosity in the code, depending on programmer use.
Rvalue references could improve performance
, depending on the extent of copy construction in the code.
Smart pointers, unique_ptr, shared_ptr and weak_ptr
are the new standard library versions of the same
from the Boost library.
This doesn't have to be an all or nothing change.
We could take individual features piecemeal and list
them on the compilation page as freeorion acceptable C++11 constructs.
The question is.
Are we interested in starting to use C++11 features?
The more leading question is.
When will we be interested in using C++11 features?
I am bringing up this topic, mostly because I want to use the type inference of auto and the
automatic iteration of the new for loops.
Obviously, if the minimum versions of the compilers that we support do not support any features
of C++11 then this is a non-starter.
I think that the OSs/compilers that we are supporting are Apple/Clang(XCode), Linux/GCC, and Windows/MSVC.
I don't know what minimum versions of those compilers that we support.
The linked table shows C++ support in various compilers by version.
All C++11 features are supported by Clang 3.3, GCC 4.8.1 and MSVC 14.0.
Most features are supported by Clang 3.1, GCC 4.6, and MSVC 12.0.
Current compilers versions are Clang 3.8, GCC 5.3, and MSVC 14.0.
http://en.cppreference.com/w/cpp/compiler_support
C++11 features can simplify code for reading, improve performance and increase robustness.
The auto keyword, constexpr, ranged-for loop and initializer lists
all trivially improve readability and ease of writing.
Lambda expression can reduce verbosity in the code, depending on programmer use.
Rvalue references could improve performance
, depending on the extent of copy construction in the code.
Smart pointers, unique_ptr, shared_ptr and weak_ptr
are the new standard library versions of the same
from the Boost library.
This doesn't have to be an all or nothing change.
We could take individual features piecemeal and list
them on the compilation page as freeorion acceptable C++11 constructs.