?
2011-02-16 13:58:39 UTC
//file: my.h
#ifndef MY_H
#define MY_H
//class definition goes here
#include "my.cpp"
#endif
//file: my.cpp
#ifdef MY_H
#ifndef MY_CPP
#define MY_CPP
//Class implementation goes here
#endif
#endif
Is it OK to do it? I usually find it done the other way -- the CPP includes the H, but then you need to somehow tie all the CPP files together which is inconvenient. My method lets me type:
g++ myapplication.cpp
But their way makes me type:
g++ myapplication.cpp my.cpp
So am I missing something here? Or did I make some sort of breakthrough (not!)?