Subject: Re: [boost] [review] string convert
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2011-05-05 15:27:16
Jeremy Maitin-Shepard wrote:
> On 05/05/2011 10:32 AM, Stewart, Robert wrote:
> > Jeff Flinn wrote:
> >> Stewart, Robert wrote:
> >>> If one wants an exception to indicate conversion failure,
> >>> an initial value is needed and the desire for an exception
> >>> must be noted:
> >>> example const e(convert_cast<example>("1", 3, throw_));
> >> Sorry if I'm just being dense, but if the above throws, the
> >> default value is never used, so why supply it?
> > Think about how convert_cast() might be implemented:
> Is conflating the fallback value with the initial value used by
> a stringstream-based implementation really a good idea?
In that overload, there is no fallback value. It is the initial value.
In a nothrow overload, the two would be conflated.
However, the default_value CP eliminates this need.
Rob Stewart robert.stewart_at_[hidden]
Software Engineer using std::disclaimer;
Dev Tools & Components
Susquehanna International Group, LLP http://www.sig.com
IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk