
From: "Yuval Ronen" <ronen_yuval@yahoo.com>
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! :-)
My question is, why does it do this - as this specifically stops lexical_cast from working with complex types. So could this be an
You're welcome. :) 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