[ROOT] template class and VC++ 6

From: Heather Kelly (heather@lheapop.gsfc.nasa.gov)
Date: Thu Oct 10 2002 - 16:51:55 MEST


Hi,

I am using ROOT 3.02.07 on both Windows and Linux.  I was just trying to 
introduce a new template class, and I started to run into problems.
I went back to the user's guide and decided to implement the simple 
example, where I just define a header file - in this case rather than 
MyClass1.h I call it Relation.h:

#ifndef RELATION_H
#define RELATION_H

template <typename T> class Relation {
private:
	T fA;
	
public:
	Relation() {};
	~Relation() {};
	ClassDefT(Relation,1)
};
ClassDefT2(Relation,T)
ClassImpT(Relation,T)
#endif



My LinkDef file is:

#ifdef __CINT__

#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class Relation<int>+;
#endif


This compiles just fine on Linux using gcc 2.91.  However, it fails on 
Visual C++ 6.0.  I am not sure if this is a deficiency in the VC++ compiler 
or an error on my part.  The first error message is:

commonRootData_rootcint.cxx(17) : error C2143: syntax error : missing ';' 
before '<'
Which refers to this line in the rootcint file:
template <> TBuffer &operator>><int >(TBuffer &buf, Relation<int> *&obj)

Any suggestions would be welcome.

Thanks,
Heather



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:14 MET