R
Renzr
In the current project i involved, the hiding the template
specialization by inheriting is a desired goal. but my code can not be
complied correctly. I realy want someone can do me a favor. the code is
listed below:
// base.h
#ifndef BASE_H
#define BASE_H
template < class T > class Base
{
private:
T* _read;
const T* write;
};
#endif // base_h
// derived.h
#ifndef DERIVED_H
#define DERIVED_H
include "base.h"
#include "mt.h"
// class mt is defined in mt.h and implemented in mt.cpp
class MT;
class Derived: public Base <MT>
{
};
#endif // derived.h
when compling the codes above with g++, the error massage is listed as
below.
error: `MT' is not a template type
I realy want someone can do me a favor
specialization by inheriting is a desired goal. but my code can not be
complied correctly. I realy want someone can do me a favor. the code is
listed below:
// base.h
#ifndef BASE_H
#define BASE_H
template < class T > class Base
{
private:
T* _read;
const T* write;
};
#endif // base_h
// derived.h
#ifndef DERIVED_H
#define DERIVED_H
include "base.h"
#include "mt.h"
// class mt is defined in mt.h and implemented in mt.cpp
class MT;
class Derived: public Base <MT>
{
};
#endif // derived.h
when compling the codes above with g++, the error massage is listed as
below.
error: `MT' is not a template type
I realy want someone can do me a favor