C T B H P N

ClassAnatomy.h, ClassAnatomy.cpp, ClassAnatomy.txt, Code folder, Classes webpage

Illustrates all of the basic parts of a class, e.g., Constructors, operators, destructor, and member data.

ClassAnatomy.txt

  Demonstrate Test Class
 ------------------------
  -- promotion construction of Test Fred   at line #150 int main(void)
  named construction of Fred               at line  #68 Test::Test(const class std::basic_string<char,struct std::ch
  -- copy construction of Test Fred        at line #152 int main(void)
  copy of Fred                             at line  #75 Test::Test(const class Test &)
  -- call demoFunc()                       at line #154 int main(void)
  named construction of function demo's te at line  #68 Test::Test(const class std::basic_string<char,struct std::ch
  function demo's temporary Test           at line #139 class Test demoFunc(void)
  move of function demo's temporary Test   at line  #82 Test::Test(class Test &&)
  destruction of                           at line #111 Test::~Test(void)
  -- void construction of unnamed Test     at line #156 int main(void)
  void construction of Test                at line  #60 Test::Test(void)
  -- assignment of Test Fred               at line #158 int main(void)
  copy assignment of Fred                  at line  #92 class Test &Test::operator =(const class Test &)
  -- assignment of temporary test          at line #160 int main(void)
  void construction of Test                at line  #60 Test::Test(void)
  move assignment of unnamed               at line #103 class Test &Test::operator =(class Test &&)
  destruction of                           at line #111 Test::~Test(void)

  Creating initialized std::vector of Tests
 -------------------------------------------
  -- initialize vector with copies of t1 & at line #169 int main(void)
  copy of t1                               at line  #75 Test::Test(const class Test &)
  copy of t2                               at line  #75 Test::Test(const class Test &)
  move of t3                               at line  #82 Test::Test(class Test &&)
  copy of t1                               at line  #75 Test::Test(const class Test &)
  copy of t2                               at line  #75 Test::Test(const class Test &)
  copy of t3                               at line  #75 Test::Test(const class Test &)
  destruction of t3                        at line #111 Test::~Test(void)
  destruction of t2                        at line #111 Test::~Test(void)
  destruction of t1                        at line #111 Test::~Test(void)
  my name is t1
  my name is t2
  my name is t3

  Testing push_backs
 --------------------
  -- promotion construction of t4          at line #179 int main(void)
  named construction of t4                 at line  #68 Test::Test(const class std::basic_string<char,struct std::ch
  -- promotion construction of t5          at line #181 int main(void)
  named construction of t5                 at line  #68 Test::Test(const class std::basic_string<char,struct std::ch
  -- push_back of t4                       at line #183 int main(void)
  copy of t4                               at line  #75 Test::Test(const class Test &)
  copy of t1                               at line  #75 Test::Test(const class Test &)
  copy of t2                               at line  #75 Test::Test(const class Test &)
  copy of t3                               at line  #75 Test::Test(const class Test &)
  destruction of t1                        at line #111 Test::~Test(void)
  destruction of t2                        at line #111 Test::~Test(void)
  destruction of t3                        at line #111 Test::~Test(void)
  -- push_back of std::move(t5)            at line #185 int main(void)
  move of t5                               at line  #82 Test::Test(class Test &&)
  copy of t1                               at line  #75 Test::Test(const class Test &)
  copy of t2                               at line  #75 Test::Test(const class Test &)
  copy of t3                               at line  #75 Test::Test(const class Test &)
  copy of t4                               at line  #75 Test::Test(const class Test &)
  destruction of t1                        at line #111 Test::~Test(void)
  destruction of t2                        at line #111 Test::~Test(void)
  destruction of t3                        at line #111 Test::~Test(void)
  destruction of t4                        at line #111 Test::~Test(void)
  my name is t1
  my name is t2
  my name is t3
  my name is t4
  my name is t5

  Creating vector of smart pointers
 -----------------------------------
  -- attach unique_ptr sp1 to new Test t6  at line #201 int main(void)
  named construction of t6                 at line  #68 Test::Test(const class std::basic_string<char,struct std::ch
  -- attach unique_ptr sp2 to new Test t7  at line #203 int main(void)
  named construction of t7                 at line  #68 Test::Test(const class std::basic_string<char,struct std::ch
  -- create vector of these unique_ptrs    at line #205 int main(void)
  -- push_back std::move(sp1)              at line #207 int main(void)
  -- push_back std::move(sp2)              at line #209 int main(void)
  -- reset sp2 to new Test(t8)             at line #223 int main(void)
  named construction of t8                 at line  #68 Test::Test(const class std::basic_string<char,struct std::ch
  -- reset sp2 to new Test(t9)             at line #225 int main(void)
  named construction of t9                 at line  #68 Test::Test(const class std::basic_string<char,struct std::ch
  destruction of t8                        at line #111 Test::~Test(void)
  my name is t6
  my name is t7

  Done with testing
 -------------------
  destruction of t6                        at line #111 Test::~Test(void)
  destruction of t7                        at line #111 Test::~Test(void)
  destruction of t9                        at line #111 Test::~Test(void)
  destruction of                           at line #111 Test::~Test(void)
  destruction of t4                        at line #111 Test::~Test(void)
  destruction of t1                        at line #111 Test::~Test(void)
  destruction of t2                        at line #111 Test::~Test(void)
  destruction of t3                        at line #111 Test::~Test(void)
  destruction of t4                        at line #111 Test::~Test(void)
  destruction of t5                        at line #111 Test::~Test(void)
  destruction of                           at line #111 Test::~Test(void)
  destruction of t2                        at line #111 Test::~Test(void)
  destruction of t1                        at line #111 Test::~Test(void)
  destruction of Fred                      at line #111 Test::~Test(void)

Press any key to continue . . .