Potentially useful codes in C++