Constructors do no return anything. They can not fail; they must not fail. Rewrite your code. Move the parts that can fail into an initializer.
Please EDIT your post and use the "</>" (Alt-S) for your code sample. Don't use simple text. It makes it difficult to read.
Constructors don't have return values. You can just set an internal state (member variable) to signify if it is valid or not. An option is to set a user error ...
However, I would suggest you instead just rethink your logic so as not to need an error state.
Sets the predefined variable _LastError into the value equal to ERR_USER_ERROR_FIRST + user_error

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
class Abc {
public:
Abc(string def) {
if (def != "") {
// parse def
} else {
error... how do we report an error? can I just make the constructor return something? e.g. bool Abc(string def) ?
}
}
}