Exceptions in constructor..
Suppose I have a list class and two of its constructors are like this:
Code:
list(const std::string& s);
list(const std::string& s, bool& b);
The first one throws an exception if the string is not suitable for making a list.
The second one does not throw an exception and just sets the passed boolean variable to false (after doing some cleanup).
I want to use the second one to determine if a string can be made into a list.
Is this a good design wrt to constructors and exceptions ?