Difference between revisions of "C++11 in Hall D Online"
m |
m |
||
Line 1: | Line 1: | ||
− | Below I list a number of new C++11 features that should be interesting for use in the Hall D Online. The most important ones concern programming safety, i.e. they plug safety loopholes in C++ that have been there | + | Below I list a number of new C++11 features that should be interesting for use in the Hall D Online. The most important ones concern programming safety, i.e. they plug safety loopholes in C++ that have been there since the beginning. The second type concern programming convenience, i.e. they make the code easier to write and understand. Although we do not have any hard-and-fast programming rules for the online, I strongly feel the safety features should be used in all new code. I recommend use of the convenience features, but this is a personal decision. Even if you don't use them you should be familiar with them since they will appear in online code written by others. |
Note that I take it for granted the old C++98 features will be used regularly (e.g. the STL). | Note that I take it for granted the old C++98 features will be used regularly (e.g. the STL). | ||
− | For a comprehensive discussion of C++11 see the Wikipedia article on [http://en.wikipedia.org/wiki/C%2B%2B11 C++11]. See also the article on [http://www.codeproject.com/Articles/570638/Ten-Cplusplus11-Features-Every-Cplusplus-Developer Ten C++11 Features Every C++ Developer Should Use]. | + | My discussion below is brief. For a comprehensive discussion of C++11 see the Wikipedia article on [http://en.wikipedia.org/wiki/C%2B%2B11 C++11]. See also the article on [http://www.codeproject.com/Articles/570638/Ten-Cplusplus11-Features-Every-Cplusplus-Developer Ten C++11 Features Every C++ Developer Should Use]. |
Line 9: | Line 9: | ||
'''Safety''' | '''Safety''' | ||
+ | override | ||
+ | nullptr | ||
+ | static assert and type traits | ||
+ | smart pointers | ||
+ | move semantics | ||
+ | thread library | ||
+ | '''Convenience''' | ||
− | + | auto | |
− | + | range-for | |
+ | initializer lists | ||
+ | constructor chaining | ||
+ | lambdas | ||
+ | tuples | ||
+ | new algorithms | ||
+ | regular expressions |
Revision as of 15:46, 11 July 2013
Below I list a number of new C++11 features that should be interesting for use in the Hall D Online. The most important ones concern programming safety, i.e. they plug safety loopholes in C++ that have been there since the beginning. The second type concern programming convenience, i.e. they make the code easier to write and understand. Although we do not have any hard-and-fast programming rules for the online, I strongly feel the safety features should be used in all new code. I recommend use of the convenience features, but this is a personal decision. Even if you don't use them you should be familiar with them since they will appear in online code written by others.
Note that I take it for granted the old C++98 features will be used regularly (e.g. the STL).
My discussion below is brief. For a comprehensive discussion of C++11 see the Wikipedia article on C++11. See also the article on Ten C++11 Features Every C++ Developer Should Use.
Safety
override nullptr static assert and type traits smart pointers move semantics thread library
Convenience
auto range-for initializer lists constructor chaining lambdas tuples new algorithms regular expressions