When is it right for a constructor to throw an exception?
The constructor’s job is to bring the object into a usable state. There are basically two schools of thought on this. One group favors two-stage construction. The constructor merely brings the object into a sleeper state in which it refuses to do any work. There’s an additional function that does the actual initialization. I’ve never … Read more