Re: passing arguments by reference

Fons Rademakers (Fons.Rademakers@cern.ch)
Thu, 18 Jun 1998 13:24:12 +0200


Hi Damir,

this bug has been fixed by Masa in the lastest version of CINT.
We expect to have this CINT version in the next ROOT release.

Cheers, Fons.

PS: instead of Print(const int &name) why not just Print(int name),
no need to pass basic types by reference.

Damir Buskulic wrote:
>
> Hi,
>
> I have a method Print(const int& name) that waits a reference to a
> variable. In a compiler, if I do f->Print(15), the compiler generates an
> internal variable and everything seems OK.
> In cint, if I do the same, I get a SEG fault. If I use a variable,
> everything works as expected.
>
> Is this call completely illegal in C++ ? If so, why does cint segfaults
> instead of saying that I shouldn't do that ?
>
> Cheers
>
> Damir
> --
> =====================================================================
> | Damir Buskulic | Universite de Savoie/LAPP |
> | | Chemin de Bellevue, B.P. 110 |
> | Tel : +33 (0)450091600 | F-74941 Annecy-le-Vieux Cedex |
> | e-mail: buskulic@lapp.in2p3.fr | FRANCE |
> =====================================================================
> mailto:buskulic@lapp.in2p3.fr

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland          Phone: +41 22 7679248
E-Mail: Fons.Rademakers@cern.ch              Fax:   +41 22 7677910