I was looking at the Google C++ Style Guide and they have decided not to use exceptions in C++ code, relying on return values instead.
My question is: How do you handle failure in constructors in this case, since you cannot return a value in those.
Thanks!
My first instinct would be to take the failure point out of the constructor, and create an initialisation method.
This way you can create your object without fear of failure, then call the init() function. That function can return something like an int for success/failure, for example -1 if the failure occurs.
Yes this is an extra step, but it does get you around not being able to fail a constructor