Intro
When programming in C and C++ you usually split your function prototypes and actual functions into a .h
/.hpp
and .c
/.cpp
file. Sadly it's very tedious to transfer the function prototypes from one file to another, and requires opening both files at the same time (or a good memory), as well as a lot of unnecessary typing, especially when changes to the arguments or member names are made.
Example
foo.hpp
:
int someFunction(int someArgument);
class someClass
{
public:
someClass();
~someClass();
int anotherFunction(int anotherArgument);
};
foo.cpp
:
#include "foo.hpp"
int someFunction(int someArgument)
{
// Code goes here
}
someClass::someClass()
{
// Code goes here
}
someClass::~someClass()
{
// Code goes here
}
int someClass::anotherFunction(int anotherArgument)
{
// Code goes here
}
Question
Is there a way to automatically create and update the functions in foo.cpp
using the definitions and prototypes in foo.hpp
?