I always feel pain when I switch from C # or python to C ++ and meet the separation of .h and .cpp.
So, I thought that perhaps there is a tool that, at the stage of preliminary compilation, can take the header (o file with some special extension) and split it into .h and .cpp?
So, if the source file looks like this:
class MyClass { public: void HaHaHa() { //some logic } }
And the result will be like .h and .cpp files:
//.h class MyClass { public: void HaHaHa(); } // .cpp #include "MyClass.h" void MyClass::HaHaHa() { //some logic }
Some search engines did not have any ready-to-use tools. But I'm sure this is not a new idea, and such tools should exist.
PS It is known that, for example, Visual Assist X and VIM have tools for handling .h and .cpp separation with less pain. But I'm asking about the possibility of having code in one file and automatically separating it as part of the build process.
source share