I always feel a pain when I switch from C# or python back to C++ and meet the .h and .cpp separation.
So I thought that maybe there is a tool that at pre-compilation step can take header (o file with some special extension) and split it to .h and .cpp?
So if original file like this:
class MyClass
{
public:
void HaHaHa()
{
//some logic
}
}
And a result would be as .h and .cpp files:
//.h
class MyClass
{
public:
void HaHaHa();
}
// .cpp
#include "MyClass.h"
void MyClass::HaHaHa()
{
//some logic
}
Some googling didn't show up the ready to use tools. But I'm pretty sure it is not a new idea and such tools should exist.
P.S. It is known that i.e. Visual Assist X and VIM has tools to handle .h and .cpp separation with less pain. But I'm asking about a possibility to have a code in one files and separate them automatically as a part of build process.