Developers thoughts

Bringing C++ Legacy Code Under Test

Why Should We Bring Legacy Code Under Test? In long-standing software projects, making changes without introducing bugs can be tricky. For newcomers to a codebase, understanding existing logic and modifying it safely is often a challenge. New employees may hesitate to refactor code if they aren’t sure whether it still functions as expected. Sometimes, even […]

continue reading...

std::shared_ptr’s aliasing constructor peculiarities

Prerequisites This blog post assumes that you already have an understanding of the normal use case of a std::shared_ptr, which is to manage the lifetime of a shared object that is being used from multiple locations. In addition, you should have read the previous blog post in this series. Refresher In the last blog post, […]

continue reading...

std::shared_ptr’s aliasing constructor

Prerequisites This blog post assumes that you already have an understanding of the normal use case of a std::shared_ptr, namely managing the lifetime of a shared object that is being used from multiple locations. The problem Imagine you have a configuration object in your project that you hold via a std::shared_ptr. For instance, like so: […]

continue reading...