E
er
hi,
suppose i have
a)
template<typename T>
class B{
A*
public:
/* depends on T*/
};
or
b)
class B{
A*
public:
template<typename T>
double f(T&); /* impl depends on T */
};
-if the template was not there i would only need to declare A in the
header of B and #include "A.h" in its source file.
- with the inclusion model (declaration & definitions included in a
common hpp) for templates, i obviously cannot do this.
- for b) i did not run into problem with a toy problem (as above) by
keeping the definitions of B::f(T&) in the header, and every other
definition in the cpp file.
-but for a more complex class, for b) i did run into problem "invalid
use of undefined struct `A"class.
before i start looking into the explicit and separation models (i
remember running into problems with export with g++) -if at all useful
in this case- could someone please offer a little of guidance on this
issue?
suppose i have
a)
template<typename T>
class B{
A*
public:
/* depends on T*/
};
or
b)
class B{
A*
public:
template<typename T>
double f(T&); /* impl depends on T */
};
-if the template was not there i would only need to declare A in the
header of B and #include "A.h" in its source file.
- with the inclusion model (declaration & definitions included in a
common hpp) for templates, i obviously cannot do this.
- for b) i did not run into problem with a toy problem (as above) by
keeping the definitions of B::f(T&) in the header, and every other
definition in the cpp file.
-but for a more complex class, for b) i did run into problem "invalid
use of undefined struct `A"class.
before i start looking into the explicit and separation models (i
remember running into problems with export with g++) -if at all useful
in this case- could someone please offer a little of guidance on this
issue?