Bits of code for C++