|
Boost : |
From: Kevlin Henney (kevlin_at_[hidden])
Date: 2005-05-03 03:27:22
In message <8dee398f92d54b9e2f27e107ee73052c_at_[hidden]>, Dave Dribin
<dave-ml_at_[hidden]> writes
>On May 1, 2005, at 1:56 PM, Kevlin Henney wrote:
>> This issue of providing a default value in case of failure was
>>discussed in the early days of lexical_cast, but not included. In
>>fact, if you go back far enough, opting for the default or zero
>>constructed value of the target rather than throwing an exception was
>>the original behaviour.
>>
>> However, the accommodation of an additional argument was not included
>>in lexical_cast in part for the simple reason that it ceases to look
>>like a cast and in part because once you start down that road there
>>are a number of additional arguments and options that you might want
>>that are "reasonable". It was felt that much of this would be better
>>off in a general conversions library that had no pretensions to being
>>cast-like.
>
>I agree that the default behavior should throw an exception. It just
>seems silly to create a whole new library that could be done in an
>existing one with about 5 lines of code. And I'd prefer a
>multi-argument cast-like function than include yet *another* 3rd party
>library with my application. Anyhow, I have an idea or two as
>alternatives. If you're interested, lemme know, otherwise I'll drop
>the whole idea. :)
I'd be interested to hear your ideas.
Kevlin
-- ____________________________________________________________ Kevlin Henney phone: +44 117 942 2990 mailto:kevlin_at_[hidden] mobile: +44 7801 073 508 http://www.curbralan.com fax: +44 870 052 2289 Curbralan: Consultancy + Training + Development + Review ____________________________________________________________
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk