...

/

Non-performance-Related C++ Language Features

Non-performance-Related C++ Language Features

Learn about the value semantics and const correctness features related to the robustness of the C++ language.

C++ language features

It’s tempting to believe that C++ should only be used if performance is a major concern. Isn’t it the case that C++ just increases the complexity of the code base due to manual memory handling, which may result in memory leaks and hard-to-track bugs?

This may have been true several C++ versions ago, but a modern C++ programmer relies on the provided containers and smart pointer types, which are part of the standard library. A substantial part of the C++ features added over the last 10 years has made the language both more powerful and simpler to use.

We would like to highlight some old but powerful features of C++ here that relate to robustness rather than performance, which are easily overlooked:

  • Value semantics
  • Const correctness
  • Object ownership
  • Deterministic destruction
  • References

Value semantics

C++ ...