Re: [ROOT] root(cint) and template

From: Jacek M. Holeczek (holeczek@us.edu.pl)
Date: Fri May 11 2001 - 09:28:05 MEST


Hi,
Thanks for your help. Indeed, replacing Complex by Complex<...> helped.
Now I get (root 3.00/06, RH6.1/i386) :
	root [0] {#include "Complex"}  
	root [1] Complex<double> a(1.0, 2.0)
	root [2] a                          
	(class Complex<double>)141923096
	root [3] cout << a                  
	Error: Unexpected EOF G__fignorestream():3 FILE:Complext.hxx LINE:144
	Advice: You may need to use +P or -p option
	((const int)0
	*** Interpreter error recovered ***
The code in question is :
	template <class _FLT> inline _FLT
	real (const Complex<_FLT>& x) __attribute__ ((const));
			// (a completely empty line 144 is here ...)
	template <class _FLT> inline _FLT
	real (const Complex<_FLT>& x)
	{
	  return x.real ();
	}
where (previously, in the same file) :
	#if ! defined (__GNUG__) && ! defined (__attribute__)
	#define __attribute__(foo) /* Ignore.  */
	#endif
What now ?
Thanks in advance,
Jacek.
P.S. What I try to do is to get the template version of Complex class in
     ROOT. The original code is taken from the GNU ANSI C++ Library. It
     was modified to make sure that the real and imaginary part are stored
     in contiguous elements of a two element array. This eliminates any
     padding between the real and imaginary parts, allowing the class to
     be later mapped correctly onto packed complex arrays (I hope). Jacek.



This archive was generated by hypermail 2b29 : Fri Jun 08 2001 - 11:51:24 MEST