chapter 6 exercise 6-3: the given program compiles ok, but throw an exception when run. replace v.end() with an back_inserter works fine