PS std::setw is the only one of the i/o manipulator that isn't "sticky". With the others (that set something) -- including std::setprecision, std::right, and std::fixed -- once you've set them they stay set, until you reset or set them again.
Does CDefect::r need to be a double (or float?) value? If the ID is always a whole number you could use an integral type instead.