M
Marc Schellens
I have:
template<class Sp>
class Data_: public Sp
{
public:
typedef typename Sp::Ty Ty;
typedef Sp Traits;
private:
typedef typename Sp:ataT DataT;
DataT dd; // the data
public:
//structors
~Data_() {};
// default
Data_(): Sp(), dd() {}
....
// line 169
// convert *this to other 'destTy'
BaseGDL* Convert2( DType destTy,
BaseGDL::Convert2Mode=BaseGDL::CONVERT);
// line 174
// make all other Convert2 functions friends
template<class Sp2>
friend BaseGDL* Data_<Sp2>::Convert2( DType destTy,
BaseGDL::Convert2Mode);
....
};
which compiles fine with gcc 3.2
But with gcc 3.3 I got:
datatypes.hpp:174: error: prototype for `template<class Sp2> BaseGDL*
Data_::Convert2(DType, BaseGDL::Convert2Mode)' does not match any in
class `Data_<<anonymous template type parameter> >'
datatypes.hpp:169: error: candidate is: BaseGDL* Data_<<anonymous
template type parameter> >::Convert2(DType, BaseGDL::Convert2Mode)
Question: is this not standard conform? If not, any suggestions how to
do it (having one template member function wich is friend to all
instantiations of the template)?
Or is it a glitch in the compiler?
thanks,
marc
template<class Sp>
class Data_: public Sp
{
public:
typedef typename Sp::Ty Ty;
typedef Sp Traits;
private:
typedef typename Sp:ataT DataT;
DataT dd; // the data
public:
//structors
~Data_() {};
// default
Data_(): Sp(), dd() {}
....
// line 169
// convert *this to other 'destTy'
BaseGDL* Convert2( DType destTy,
BaseGDL::Convert2Mode=BaseGDL::CONVERT);
// line 174
// make all other Convert2 functions friends
template<class Sp2>
friend BaseGDL* Data_<Sp2>::Convert2( DType destTy,
BaseGDL::Convert2Mode);
....
};
which compiles fine with gcc 3.2
But with gcc 3.3 I got:
datatypes.hpp:174: error: prototype for `template<class Sp2> BaseGDL*
Data_::Convert2(DType, BaseGDL::Convert2Mode)' does not match any in
class `Data_<<anonymous template type parameter> >'
datatypes.hpp:169: error: candidate is: BaseGDL* Data_<<anonymous
template type parameter> >::Convert2(DType, BaseGDL::Convert2Mode)
Question: is this not standard conform? If not, any suggestions how to
do it (having one template member function wich is friend to all
instantiations of the template)?
Or is it a glitch in the compiler?
thanks,
marc