Adding compact binary format to c++