Hi Laurent,
I run your test and got:
root.exe [1] .x test.C()
OK
OK
So nothing strange. It is for version 2.24/02 7 April 2000
Victor
Laurent APHECETCHE wrote:
>
> Hi,
>
> I have a problem with copy ctor and RootCint. To illustrate the problem
> please see the macro below. It works fine when compiled. Could you
> please
> explain this behavior ? Am I doing something wrong ?
>
> Regards,
>
> -------------
>
> #ifndef __CINT__
> #include <cstdio>
> #endif
>
> class A {
> public:
> A() { }
> A(const A& a) { printf("oups...\n") ; }
> virtual ~A() { }
> } ;
>
> class B : public A {
> public:
> B() { }
> virtual ~B() { }
> } ;
>
> class C {
> public:
> C() { }
> ~C() { }
> void test(const A& a) { printf("OK\n") ; }
> } ;
>
> void RootCopy(void)
> {
> A a ;
> B b ;
> C c ;
>
> // should produce "OK"
> c.test(a) ;
> // should also produce "OK" but produces "oups... OK"
> c.test(b) ;
> }
>
> #ifndef __CINT__
>
> int main(void)
> {
> RootCopy() ;
>
> }
>
> #endif
> --
> Dr. Laurent APHECETCHE (mailto:aphecetc@in2p3.fr) | TAPS/PHENIX/ALICE
> SUBATECH-Ecole des Mines de Nantes-4 rue Alfred Kastler-44070 NANTES
> cedex 03
> TEL (+33/0) 2 51 85 84 17 - FAX (+33/0) 2 51 85 84 24 (France)
> http://www-subatech.in2p3.fr/~photons -
> http://www.phenix.bnl.gov/~aphecetc
--
Victor M. Perevoztchikov perev@bnl.gov perev@vxcern.cern.ch
Brookhaven National Laboratory MS 510A PO Box 5000 Upton NY 11973-5000
tel office : 631-344-7894; fax 631-344-4206; home 631-345-2690
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:24 MET