I'm working on a C++ project where I've implemented every class as a separate .h file and .cpp file. I'm finding out this wasn't worth the hassle. - I'm editing back and forth between two files - It caused me a lot of unsuspected headaches (having to add predeclaration, explicitly export templated classes) - I don't see a direct benefit, my code base is bound to stay relatively small (say < 10,000 lines of code) and compilation time isn't substantial.
My question is two fold
a) Is there a benefit I might have missed in keeping implementation and prototype separated?
b) If not, is there any free tool or ide that has the capability of merging a cpp file back into the header file?
/sarcasmEven the temptation to do this is a fundamental misunderstanding of how the compilation process works.#includeliterally includes the text of the file into the other file. If you're using MSVC, there is an option to retain the preprocessor outputs (*.i), which will shed even more light on this.