mercredi 22 août 2018

C++11 style: how to initialize multiple values?

I tried to implement an IntCell class based on Weiss' book "Data Structures and Algorithms Analysis in C++". It's shown as in Fig. 1.18 of the textbook:

enter image description here

There are 2 questions:

  1. If I want to follow Weiss' suggestion of adding additional initialization list into move constructor, how shall I modify the initialization part explicit IntCell()? enter image description here

  2. How to separate the interface and implementation of the code into .hpp and .cpp files? Especially, how to write proper code in .hpp and .cpp for the initialization part: enter image description here

    What if I want to include vector items also?

Thanks!

Aucun commentaire:

Enregistrer un commentaire