Answers

Question and Answer:

  Home  C++ Constructors

⟩ Tell me how should a constructor handle a failure?

Throw an exception

Constructors don't have a return type, so it's not possible to use return codes. The best way to signal constructor failure is therefore to throw an exception.

 210 views

More Questions for you: