Posts Tagged “C++”
Today, while writing some unit tests, I encountered a challenge. The user story was that, when a Person’s details are updated, the display should be updated to reflect the changes. I’d implemented this feature using a signal on the person class that will be called whenever any details are updated: This is a fairly standard [...]
Warning: this article is no longer being actively updated and parts of it are probably out of date. Proceed with caution! Update (Nov 2009): the custom log formatter in this article is now part of the Boost Unit Test Library, via the compiler_log_formatter. So you don’t need to roll your own anymore! (Thanks Sean for [...]
Here’s something I encountered today when writing some C++: When run, this code will write “error: St9exception”, instead of “some message” to stdout. “St9exception” comes from libstdc++, in which the default value returned by std::exception::what() is the mangled symbol name. The mistake was that I was catching the exception by value, not by reference. (Too [...]


