Exercises taken from the C++ Primer 5th edition