Boost logo

Boost :

From: Yuval Ronen (ronen_yuval_at_[hidden])
Date: 2006-04-11 01:28:30

Yuval Ronen wrote:
> OK. If only boost::lexical_cast was doing it, we could actually use it...

And maybe not even then.

Providing a uniform interface for conversion from any type to any type
using an intermediate string sounds good at first, but when you think of
it, it's quite useless. I've *never* had any need to convert between two
types via a string. All I needed was to serialize to string, and
de-serialize from string. These two usages are inherently different
because de-serialization can fail, while serialization always succeeds.
This means different interface by two separate functions - the
de-serialization interface (and only it) should account for error handling.

Insisting on the current cast-like interface is no good, since it
prevents much needed interface improvements such the one I mentioned,
and others Stefan Slapeta mentioned in his post.

I hope the interface accepted to the standard will take this into account...


Boost list run by bdawes at, gregod at, cpdaniel at, john at