Some common utility in C++ programming