Merged solutions in C++