
23 Jun
2010
23 Jun
'10
3:13 p.m.
On 6/23/2010 11:01 AM, Eric Niebler wrote:
For valid input, I would prefer if unquote found a way to muddle through and do something reasonable. Throwing an exception when a trailing quote is missing seems like smacking someone's hand when they forgot to say "mother may I?" Why not just accept it? And document that fact! If the string is malformed in a way that you really can't muddle on, then throw something derived from runtime_error.
Or, better yet, the algorithm could return std::pair<OutIt, error_condition>, where OutIt is as far as the algorithm got, and error_condition is an enum describing the error if any. -- Eric Niebler BoostPro Computing http://www.boostpro.com