Classes | Functions
value_ptr_test_5.cc File Reference
#include "cetlib/value_ptr.h"
#include <cassert>

Go to the source code of this file.

Classes

struct  ptr_to_T< T >
 
class  base
 
class  derived
 

Functions

int main ()
 

Function Documentation

int main ( void  )

Definition at line 121 of file value_ptr_test_5.cc.

122 {
123  assert(base::n_alive == 0);
124  assert(derived::n_alive == 0);
125 
126  {
127  ptr_to_T<base> a(new derived(10));
128  assert(base::n_alive == 1);
129  assert(derived::n_alive == 1);
130  assert(derived::n_cloned == 0);
131 
133  assert(base::n_alive == 2);
134  assert(derived::n_alive == 2);
135  assert(derived::n_cloned == 1);
136 
137  assert(*(a.p) == *b);
138  assert(a.p->isSame(*b) == false);
139  } // a and b destroyed
140 
141  assert(base::n_alive == 0);
142  assert(derived::n_alive == 0);
143 
144 } // main()
static int n_alive
const double a
static int n_alive
static int n_cloned
static bool * b
Definition: config.cpp:1043