What\'s the best technique for exiting from a constructor on an error condition in C++? In particular, this is an error opening a file.
Thanks for the responses. I\'
In general, you should throw an exception. The alternative is to have some half-correctly constructed object which the user has to test somehow, which they will inevitably fail to do.