Re: [ROOT] Templates and ClassDefT

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Sun Nov 04 2001 - 17:43:33 MET


Micheal,

  please send me a small but complete example that I can test and try to
correct.

Cheers, Fons.


On Sunday 04 November 2001 13:43, Michael Bussmann wrote:
> Hi Fons,
>
> Many thanks for answering on a Sunday :)
>
> Did what you proposed, but now I get these error-messages during
> compilation:
>
> for ClassDefT it gives me:
>
> warning: friend declaration `class TBuffer & operator >>(class TBuffer &,
> class TAMMakeTestPartSurv<NUMBER,VALUE> *&)' warning:   declares a
> non-template function
> (if this is not what you intended, make sure the function template has
> already been declared, and add <> after the function name
> here)
>
> and for ClassDef2T2 I get:
>
> use of class template `template <class NUMBER, class VALUE>
> TAMMakeTestPartSurv<NUMBER,VALUE>' as expression `NUMBER' was not declared
> in this scope
> `VALUE' was not declared in this scope
>
> and last but not least for ClassImp2T:
>
> ANSI C++ forbids declaration `ClassDef2T2' with no type
> initializer list being treated as compound expression
> syntax error before `('
>
> Mmmh, I think it's just the first comma in the <> brackets used in the old
> version which makes all the trouble:
>
> ClassDefT(TB<T1,T2>, 1)
>                ^
>
>            trouble!
>
> Greetings from Munich, Michael
>
> On Sun, 4 Nov 2001, Fons Rademakers wrote:
> > Hi Michael,
> >
> >   could you try:
> >
> >    ClassDefT(TB,1)
> >  }
> >  ClassDef2T2(TB, P1, P2)
> >
> > the ClassImp2T and explicit instantiation look ok.
> >
> > Cheers, Fons.

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7679480



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:06 MET