Boost logo

Boost :

Subject: Re: [boost] [RFC] string inserter/extractor "q u o t i n g"
From: Eric Niebler (eric_at_[hidden])
Date: 2010-06-23 11:13:03


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

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk