Code For Chapter 5 Part 1 In C++

Can anyone give me the Code for at least chapter 5 part 1 in C++? I'm especially interested in the implementation of the method
Inventory::addInstrument(..., InstrumentSpec spec);
If the method is called I pass a GuitarSpec object (which works). But inside the method I can't cast InstrumentSpec spec back to GuitarSpec.