I have a class.h with only structs definition
I have a methods.h with a class WW with some functions written as templates.
Ok, I have to declare into class.h instances to WW.
But, I have to declare #include class.h into WW so the templates can use the structures declared in class.h.
All can be solved if I could write forwarding at class.h, but I have not class.cpp.
Here is my code :
class.h
struct Tpun {
int one_data;
WW myww1;
};
struct Tpun {
int one_data;
WW myww1;
};
To copy to clipboard, switch view to plain text mode
methods.h
#include "class.h"
class WW {
public:
WW();
~WW();
template <class TT_stream>
void put(TT_stream &value);
};
template <class TT_stream>
void WW::put (TT_stream &value) { }
#include "class.h"
class WW {
public:
WW();
~WW();
template <class TT_stream>
void put(TT_stream &value);
};
template <class TT_stream>
void WW::put (TT_stream &value) { }
To copy to clipboard, switch view to plain text mode
Any help ?
How can I tell to class.h that uses WW ? I cant write #include "methods.h" becasue then I have circular reference ...
Have I to write class.cpp and move my structs from .h to there ?
Bookmarks