https://github.com/root-project/root
Raw File
Tip revision: 9d1aed171272a4ee709a8c585eee40fbfefbd355 authored by Fons Rademakers on 24 October 2011, 09:50:38 UTC
tag patch release v5-30-03.
Tip revision: 9d1aed1
t633.h
/* -*- C++ -*- */
/*************************************************************************
 * Copyright(c) 1995~2005  Masaharu Goto (cint@pcroot.cern.ch)
 *
 * For the licensing terms see the file COPYING
 *
 ************************************************************************/
#include <stdio.h>

int idx = 0 ;
class A {
 public:
  int a;
  int id;
  A() { a=0; id=idx++; }
  A(int x) { a = x; id=idx++; printf("A(int) %d  %d\n",a,id); }
  A(const A& x) { a = x.a; id=idx++; printf("A(A&) %d  %d\n",a,id); }
  //~A() { printf("~A() %d  %d\n",a,id); }
};


class B {
  A a[3];
 public:
  B() {
    for(int i=0;i<3;i++) a[i].a = i+1;
  }
  A& Get(int i) { return a[i]; }
};
back to top