Solutions to examples in C++ Primer