Suppose I have a list class and two of its constructors are like this:
The first one throws an exception if the string is not suitable for making a list.Code:list(const std::string& s); list(const std::string& s, bool& b);
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 ?



6Likes
LinkBack URL
About LinkBacks



