Category: C++

Interruption At Work Created A Mishap

INTERRUPTIONS AT WORK is a frequent occurrence but generally its not a big problem. This time however the unavoidable loss of focus on what you was doing before, gave an unpleasant surprise. I was adding some new functionality and had just written the following: switch (state) { case Step3: configuration.length = 10; break; } Next…


Numbers To Strings And Back Again – Standard C++ vs. Boost

CONVERTING NUMBERS TO strings or the opposite of converting strings to numbers, is an operation that is far from as trivial as one would expect from such an obvious task – at least when it comes to C++ programming using standard libraries. The converting can be performed by the iostringstream classes in the standard library….


C++ Function Hidden, Not Overloaded Nor Overridden

THE C++ INHERITANCE model can be unintuitive some times – or perhaps more correctly, its easy to get tricked by C++ in some circumstances. When having an existing code base the need sometimes comes up, that an often used class is needed with a few additional features. Not to mess with any of existing code,…


C++ Contructor/Destructor Call Order

WHEN BEGINNING C++ programming I’ve experienced people to have trouble remembering the correct construction and destruction call order. Personally I conquered this using a common memory technique – creating a story. Here are two stories that might help in remembering. The stories might seem quite long, but don’t fear, it’s not necessary to remember the…


Placement new

REPLACEMENT NEW CAME to mind, when working on a C++ project of mine. In this project some large objects of short lifetime led to a concerns about memory fragmentation on the targeted embedded platform that have only sparse memory ressources. The life cycle of the objects was to create an object, then fill the large…