|
Boost : |
Subject: Re: [boost] [Conversion] Review
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2011-08-28 06:07:05
Le 28/08/11 09:43, Antony Polukhin a écrit :
> First of all, there is already a Boost.Conversion library (released in
> 1.20.0). Users will be confused, because two libraries have same
> names.
I pretended to include the 'generic' conversions into the conversion
library.
> * What is your evaluation of the design?
>
> It is simple and looks good. But consider the following situation:
> lexical_cast<char>(1) and numeric_cast<char>(1) will produce output.
> It must be documented, which cast will your library use in which
> cases.
The documentation of header <boost/conversion/std/string.hpp> includes
"Include this file when using conversions from/to |std::string| via
|lexical_cast|. "
> There must be some tags, to allow user to choose, which conversion is
> required. There are some dummy::type_tag tags in source code, but
> looks like they are not used, and not documented!
They are used to overload the conversion functions. The class is
documented here
https://svn.boost.org/svn/boost/sandbox/conversion/libs/conversion_ext/doc/html/boost/conversion/dummy/type_tag.html.
This
https://svn.boost.org/svn/boost/sandbox/conversion/libs/conversion_ext/doc/html/boost/conversion/users_guide.html#boost.conversion.users_guide.tutorial.how_to_specialize_extrinsic_conversions_
tutorial section explains how to use it.
>
> * What is your evaluation of the documentation?
>
> There is no documentation about which conversion when used.
> convert_to<char>(1) will call numeric_cast or lexical_cast?
The library doesn't provide a conversion from int to string if you don't
include the specific file mentioned above.
>
> * Do you think the library should be accepted as a Boost library?
>
> Yes, it should. But only after the documentation will be updated and
> tags added. Until then, it is not clear which cast is when used and
> library is not as generic as possible. But such big changes to library
> design will require some new short review.
Could you elaborate on how you see the library can use these tags?
Thanks for your review,
Vicente
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk