Re: [ROOT] Templates and ClassDefT

From: Michael Bussmann (Michael.Bussmann@Physik.uni-muenchen.de)
Date: Sun Nov 04 2001 - 13:43:06 MET


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.
>



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