Boost logo

Boost :

Subject: Re: [boost] [Review] Boost.Convert library, last day
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2011-05-02 11:34:51

> This is a reminder that formal review of the Boost.Convert library by
> Vladimir Batov ends today, May 2.
> There have only been a few reviews of the library so the library welcomes
> reviews. If you are one of the people who have been dissatisfied by the
> perceived limitations of Boost lexical_cast, or have discussed such
> limitations on Boost mailing lists in the past, please look at the library
> and give a review of it, as its intent is to offer a greatly enhanced
> version of lexical_cast as a new library.

Sorry for not being able to do a full review here, even if I looked at
through the whole of the documentation I don't feel like having a definite
answer whether it should be accepted. But I tend to vote NO.

>From reading the docs I came away puzzled. It was highly confusing to me to
have the convert::from<> return different things in different contexts. I'd
suggest rethinking the API, making the different behaviors explicit.

As Thomas Heller pointed out, the existence of several default conversion
paths for the result type will (with high probability) create havoc for
users who really just want to do the conversion without spending much time
reading the docs. The current implementation of lexical_cast (even if is not
always the fastest), appeals to many people because 'it just works'. Any
conversion library needs to be similarly resilient to be useful.

To summarize: I feel uneasy to suggest accepting this library as it covers
functionality which in my opinion belongs into lexical_cast<> in the first
place. It is a natural extension of lexical_cast's functionality and for
this reason should be merged with lexical_cast instead of being accepted as
a separate library. Having two stream based conversion libraries in Boost
(which moreover while complementing each other, sometimes expose different
behavior) does not make any sense to me.

OTOH, the functionality exposed by convert is much needed and has to make it
into Boost somehow.

Regards Hartmut

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