For example, "Don't return objects by value if they are expensive to copy" (RVO can't always be used). This advice might change because of rvalue references.
The same might be said about storing collections of pointers to objects, because copying them by value into the collection was too expensive; this reason might no longer be valid.
Or the use of enums might be discouraged in favour of "enum class".
What other practices or tips will change?
For the typical C programmer, the biggest change in C11 is its standardized multithreading support. C of course has supported multithreading for decades. However, all of the popular C threading libraries have thus far been non-standard extensions, and hence non-portable. The new C11 header file <threads.
C++11 allowed lambda functions to deduce the return type based on the type of the expression given to the return statement. C++14 provides this ability to all functions. It also extends these facilities to lambda functions, allowing return type deduction for functions that are not of the form return expression; .
C11 looked to address the issues of C99 and to more closely match the C++ standard, C++11. It changes some C99 features required to optional. Some of the features include variable length arrays and complex numbers. This makes it easier for compiler vendors to meet C11's required function set.
I expect that C++ written in a functional-like style will become more prevalent because:
Improved code locality by using lambda expressions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With