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

Go to the source code of this file.

Classes

class  base
 
class  derived
 

Functions

int main ()
 

Function Documentation

int main ( void  )

Definition at line 109 of file value_ptr_test_4.cc.

110 {
111  assert(base::n_alive == 0);
112 
113  {
114  cet::value_ptr<base> a(new derived(10));
115  assert(base::n_alive == 1);
116  assert(derived::n_alive == 1);
117  assert(derived::n_cloned == 0);
119  assert(base::n_alive == 2);
120  assert(derived::n_alive == 2);
121  assert(derived::n_cloned == 1);
122 
123  assert(*a == *b);
124  assert(a->isSame(*b) == false);
125  } // a and b destroyed
126 
127  assert(base::n_alive == 0);
128  assert(derived::n_alive == 0);
129 
130 } // main()
static int n_alive
const double a
static int n_alive
static int n_cloned
static bool * b
Definition: config.cpp:1043