Some utilities in C++