Other utilities and compile-time checks
Boost includes a number of micro-libraries that provide small but useful functionalities. Most of them are not elaborate enough to be separate libraries. Instead, they are grouped under Boost.Utility
and Boost.Core
. We will look at two such libraries here.
We will also look at some useful ways to detect errors as early as possible, at compile time, and glean information about the program's compilation environment and tool chains using different facilities from Boost.
BOOST_CURRENT_FUNCTION
When writing debug logs, it is incredibly useful to be able to write function names and some qualifying information about functions from where logging is invoked. This information is (obviously) available to compilers during the compilation of sources. However, the way to print it is different for different compilers. Even for a given compiler, there may be more than one ways to do it. If you want to write portable code, this is one wart you have to take care...