Most people think that they know C++ which is used in production level as they are taught C++ in their syllabus of their university/college. But they mostly do not know what standard of C++ they are taught. They are taught C++ 89 i.e. CFront 2.0. Students are told to use Turbo C++ as IDE to learn C++ in university because it is or was a great IDE in it's age. As the academic syllabus takes a lot of time to change and people don't know that it is outdated mostly trend to learn old coding styles and deprecated features.
Modern C++ stands for C++ that is based on C++11, C++14, and C++17 C++20 and future versions.
With C++11 we had a revolution. That revolutions became with C++14 and will become with C++17 to an evolution. An overview on the time line of C++ features which makes my point clear.
Modern C++ not only enhances the usability of the C++ itself, but the modification of the
auto keyword semantics gives more confidence in manipulating extremely complex template types. At the same time, a lot of enhancements have been made to the language at runtime. The emergence of Lambda expressions has made C++ have the "closure" feature of "anonymous functions", which is almost in modern programming languages (such as Python/Swift/.. It has become commonplace, and the emergence of
rvalue references has solved the problem of temporary object efficiency that C++ has long been criticized for.
- The string literal constant is no longer allowed to be assigned to a
char *. If you need to assign and initialize a
char *with a string literal constant, you should use
const char *or
char *str = "hello world!"; // A deprecation warning will appear
set_unexpected()and other related features are deprecated and should use
auto_ptris deprecated and
unique_ptrshould be used.
registerkeyword is deprecated and can be used but no longer has any practical meaning.
boolcan no longer be incremented
If a class has a
destructor, the properties for which it generates copy constructors and copy assignment operators are deprecated.
C language style type conversion is deprecated (ie using (convert_type)) before variables, and
const_castshould be used for type conversion.
In particular, some of the C standard libraries that can be used are now deprecated in the latest C++ standard, such as
Many more that I cannot remember.
- Modern C++ Book
- Best Practices
- Awesome Modern C++
- Modern C++ Tutorials
- Iso C++
- 30 Seconds of C++
- C++ Preference
All the code used in my articles are available on Delta456/modern-cpp-series.