|
Boost : |
From: Terje Slettebø (tslettebo_at_[hidden])
Date: 2002-10-19 21:44:55
>From: "Michel André" <michel.andre_at_[hidden]>
> "Terje Slettebø" <tslettebo_at_[hidden]> wrote in message
> news:021501c277b6$0ada7f40$60fb5dd5_at_pc...
>
> >> Yes of course lexical cast should be able to perform the function as
> well.
> >> But that would require a newer more configurable lexical_cast with
> >> specializations/traits/policies for specific conversion. But thats
> underway
> >> isn't it?
>
> >Yes. The proposal here
> >(http://groups.yahoo.com/group/boost/files/lexical_cast_proposition/) can
> be
> >extended by the user to handle any user defined conversion, via
> >specialisation, or partial specialisation.
>
> Will it be okay to do own specializations of
> boost::detail::lexical_cast_impl?
> Isn't the detail namespace supposed to be private to the library? Maybe a
> public boost::lexical_cast_impl or boost::lexical_cast_traits with an
> do_cast method would be clearer.
Good point. As a matter of fact, the possibility of providing user-defined
specialisations is something that I discovered later, so lexical_cast_impl
was originally meant as an implementation detail, as you say. It uses a
struct, rather than a function, to be able to do any kind of
specialisations, including partial specialisations.
However, as you say, it may seem strange to expose "detail" namespace parts
as part of the interface. You have a couple of good suggestions, here. Since
"impl" also suggests implementation, maybe a traits class could be cleaner,
and more in the spirit of the standard library. I'll look into it.
Thanks for the feedback. :)
Regards,
Terje
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk