[ROOT] Could you explain this RootCint behavior ?

From: Laurent APHECETCHE (aphecetc@in2p3.fr)
Date: Fri Apr 28 2000 - 12:32:26 MEST


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



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:24 MET