C++ merge