Book 3 listing 6 doesn't introduce private members sqrt_spp and recip_sqrt_spp. Looking at the source code, it seems like they're declared and used inside the initialize() method. Ref
Additionally, in listing 40, it seems to introduce int sqrt_spp = int(sqrt(samples_per_pixel)); in the render() method, which I believe can be removed.
Happy to make these changes.