Move semantics have to be one of the most prominent new features in C++11. It is also something that can be a source of misunderstandings if the underlying mechanics are not fully understood. The fact is that std::move does not actually move anything. Yet, its name would suggest otherwise. So, let’s clear up this misconception.
Continue reading “Common misconception with C++ move semantics”
Category: C++
My editor of choice for C/C++: QtCreator + FakeVim
Even though I work with C/C++ projects that are not related to Qt technology, QtCreator has become my main code editor. Here I explain some of the main reasons why I prefer it over other alternatives. Continue reading “My editor of choice for C/C++: QtCreator + FakeVim”
C++ tips for easier unit testing
A while back I read the Working Effectively with Legacy Code by Michael C. Feathers. The book focuses on strategies and approaches to get existing untested legacy code covered by unit tests.
The book also includes more than twenty dependency-breaking techniques that can be used for new code as well to make it easily testable in the first place. Here I have picked three of the techniques that I have personally found most useful.
- Interfaces to abstract implementation
- Extract and override call
- Expose static method