Boost logo

Boost :

From: Terje Slettebø (tslettebo_at_[hidden])
Date: 2005-01-29 18:48:55


>From: "Yuval Ronen" <ronen_yuval_at_[hidden]>

> > There was recently another whitespace-with-lexical_cast related question
at
> > Boost users list, where the poster preferred no whitespace stripping. To
> > quote:

<snip>

> There's nothing more flattering than being quoted, thanks! :-)

You're welcome. :)

> >>My question is, why does it do this - as this specifically stops
> >>lexical_cast from working with complex types. So could this be an
option,
> >>or completely disabled, or made an option (somehow) to lexical_cast?
> >
> > Adding options to lexical_cast is difficult. It's meant to resemble
regular
> > casts, and any additional template- or function-arguments makes it no
longer
> > look like a cast.
>
> I get the feeling that making it look like a cast is being overrated.

That argument isn't really mine to begin with; Kevlin has been quite
insistent on it. :) I've been questioning it, as well. However, he has
insisted on that that lexical_cast is supposed to be a simple, quite
general-purpose conversion component, and that more "advanced" features
(such as numeric formatting, etc.) is better handled by using
std::stringstream directly. The topic has periodically come up now and then.

Regards,

Terje


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