N
nutty
Dear group,
I tested this code in a 4.x gcc, MSVC 8.0, 7.1 and comeau in strict and
relaxed mode.
It compiles in MSVC and relaxed comeau, but fails in gcc 4.x and strict
comeau
It seems it is not possible to derive from a template class and pass it
an argument that is a template parameter itself in the derived class.
This would break a lot of my code.
But I could imagine that this is just not the exactly right way to code
it. Does anyone have any hints on this?
Does anyone know, wether it is possible to tell the gcc to compile in
something similar to the comeau relaxed mode?
And finally, can anyone tell, what the standard says? I don't have the
standard unfortunately.
Thanks for your help
Ingo
// main.cpp
template< typename dataT >
struct A
{
typedef dataT DataT;
DataT* _pCol;
int _n;
};
template< typename T >
struct B : A< int >
{
typedef DataT CanISeeIt;
void func( )
{
_pCol;
_n;
}
};
template< typename T >
struct C : A< T >
{
typedef DataT CanISeeIt;
void func( )
{
_pCol;
_n;
}
};
int main( ){}
I tested this code in a 4.x gcc, MSVC 8.0, 7.1 and comeau in strict and
relaxed mode.
It compiles in MSVC and relaxed comeau, but fails in gcc 4.x and strict
comeau
It seems it is not possible to derive from a template class and pass it
an argument that is a template parameter itself in the derived class.
This would break a lot of my code.
But I could imagine that this is just not the exactly right way to code
it. Does anyone have any hints on this?
Does anyone know, wether it is possible to tell the gcc to compile in
something similar to the comeau relaxed mode?
And finally, can anyone tell, what the standard says? I don't have the
standard unfortunately.
Thanks for your help
Ingo
// main.cpp
template< typename dataT >
struct A
{
typedef dataT DataT;
DataT* _pCol;
int _n;
};
template< typename T >
struct B : A< int >
{
typedef DataT CanISeeIt;
void func( )
{
_pCol;
_n;
}
};
template< typename T >
struct C : A< T >
{
typedef DataT CanISeeIt;
void func( )
{
_pCol;
_n;
}
};
int main( ){}