Levels of Exception Safety
Exceptions are part of C++. They are thrown by the standard library classes, and sometimes even if we are not really using the standard library. So, unless we are in a very restrictive […]
Exceptions are part of C++. They are thrown by the standard library classes, and sometimes even if we are not really using the standard library. So, unless we are in a very restrictive […]
Probably everybody who has written C++03 code had the pleasure of using NULL and stumbling over one pitfall or another. C++11 brought the solution to those issues with nullptr.
Today I write about override and final, a pair of less often discussed, less complicated features introduced in C++11. Both can provide some additional security and clarity when it comes to […]
When it comes to factory functions there is often dispute on which kind of smart pointers to return. As it turns out, the choice depends on the circumstances, so here’s a list of pros and cons.
In the last post of my series about (relatively) new C++ features I introduced lambda expressions, which define and create function objects on the fly. I left a few details untouched, […]
Having covered the basics of `auto` and rvalue references, there is a third big new C++ feature definitely worth knowing about: creating function objects on the fly with lambda expressions.
The last weeks I have been writing a lot about move semantics, move operations, rvalue references and forwarding references. While it might take a bit of getting used to all this, there’s good news.
Combining rvalue references with templated function parameters or `auto` behaves quite differently than “normal” rvalue references. Together with the utility function template `std::forward` they allow something called “perfect forwarding” and are therefore also called forwarding references.
Managing the lifetime of dynamically allocated memory and the objects residing in it is one of the challenges that can be hard to do right. It is usually handled by assigning […]
After introducing the concept of move semantics and describing how move constructors and move assignment operators work, I’ll wrap up my discussion of the topic with my answer to one question: […]