in "first.h", I have:
Expand|Select|Wrap|Line Numbers
- class cache_t {
- public:
- virtual void printStats( pseq_t *pseq );
- ...
- };
- class generic_cache_block_t {
- ...
- };
Expand|Select|Wrap|Line Numbers
- template class generic_cache_template<generic_cache_block_t>;
- ...
- void cache_t::printStats( pseq_t *pseq )
- {
- ....
- }
in "second.H", I have:
Expand|Select|Wrap|Line Numbers
- generic_cache_template<generic_cache_block_t> *l2_cache;
- ....
Expand|Select|Wrap|Line Numbers
- l2_cache->printStats( this ); //error
error: invalid use of incomplete type ‘struct generic_cache_template<generic_cache_block_t>’
I have searched about this error and some say it is occurred because of something called forward deceleration (a function is called but the
class has not been instantiated yet). I doubt about existence of such issue. Any idea is appreciated.