B
booker
The following codes can't pass compilation in vc7.1,
error occured at the possition where Foo is called.
************************************************************8
template<typename type>
class base1
{
template<typename type> class base2;
private:
typedef base2<type> base2type;
public:
virtual void Foo(base2type*)=0;
};
template<typename type2>
class base2
{
};
template<typename type>
class derive
ublic base1<type>
,public base2<type>
{
typedef base2<type> base2type;
virtual void Foo(base2type*){}
};
int main(int argc, char* argv[])
{
derive<unsigned> * devptr=new derive<unsigned>;
base1<unsigned> * baseptr=devobj;
baseptr->Foo(devptr);
return 0;
}
error occured at the possition where Foo is called.
************************************************************8
template<typename type>
class base1
{
template<typename type> class base2;
private:
typedef base2<type> base2type;
public:
virtual void Foo(base2type*)=0;
};
template<typename type2>
class base2
{
};
template<typename type>
class derive
ublic base1<type>
,public base2<type>
{
typedef base2<type> base2type;
virtual void Foo(base2type*){}
};
int main(int argc, char* argv[])
{
derive<unsigned> * devptr=new derive<unsigned>;
base1<unsigned> * baseptr=devobj;
baseptr->Foo(devptr);
return 0;
}