Boost logo

Boost :

Subject: Re: [boost] [lexical_cast] A suggestion
From: Vladimir Batov (batov_at_[hidden])
Date: 2009-02-07 08:17:14


>> lexical_cast(Source const&, Target const& =Target())
>
> No, that kind of implementation seems unacceptable to me. I want
> lexical_cast to throw exceptions just as often as I don't want it to. And,
> of course, I'm against introducing a breaking change.
>
>> or most likely a completely independent overload
>>
>> lexical_cast(Source const&, Target const&)
>
> That would be my preferred way to implement this extension.

Yes, agreed. That the only IMHO way to implement that "extension" -- without
disturbing the existing lexical_cast. I threw the first one in almost
accidently. Kevlin argued (in a separate discussion) that

    lexical_cast<Foo>(string)
    lexical_cast(string, some_foo)

were distant syntactically and I argued that they were not as they could in
fact be two "sides" of the same "coin"

    lexical_cast(Source const&, Target const& =Target())

Then, I brought it to this thread just to confuse things.

V.


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