Random C++ helpers and utilities