RE: [ROOT] template function and dictionnary generation problem

From: Philippe Canal (pcanal@fnal.gov)
Date: Wed Mar 19 2003 - 18:17:33 MET


Hi Benoit,

> template void Copy(tata * dest, const tata * src);

I believe that CINT does not yet implement the explicit instantiation of a
function template.  As a work around just hide this line from CINT.

Cheers,
Philippe.

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Benoit Revenu
Sent: Wednesday, March 19, 2003 6:00 AM
To: Rene Brun
Cc: roottalk@pcroot.cern.ch
Subject: Re: [ROOT] template function and dictionnary generation problem


> Hi Benoit,
>
> CINT does not support the old style omanip (in iomanip.h).
> You have to use #ifdef to exclude it when running rootcint.
>
> Note that your code will not compile under gcc3.2.
> You better remove omanip anyhow.
>
> Rene Brun

OK, I removed the iomanip stuff. Now I try to implement another template
function :
template<class T> void Copy(T* dest, const T* src)
{
          *dest = *src;
}
and
template void Copy(tata * dest, const tata * src);

I still have the following problem with rootcint :
Error: no such template voidCopy(tata* dest,const tata* src)
FILE:../src/Class.h LINE:29

In attachement, the files illustrating the problem. The problem is
corrected when I put the template between #ifndef __CINT__ #endif
(but this time I don't use anymore iomanip).



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:10 MET