Re: [boost] [lexical cast] Performance improvements

From Gruenke, Matt
From Vicente BOTET, on Mon 4/4/2011 5:59 PM:
I think that it is better to improve my library that is there to manage with any conversion, and let lexical cast do what it did originally.
Let me know what do you think.
It didn't sound like he change the behavior of lexical_cast<>(), at all. I am very much in favor of these optimizations going in, since I have a large >amount of code which uses lexical_cast<>().
Yes, I did not changed the behavior of the library, but only added optimizations for some conversions, which sometimes occur when lexical_cast is used in generic programming. There are some more optimizations for lexical_cast in bug database (tickets #5417 and #5350)
From Vicente BOTET
Let me know what do you think.
Best,
Vicente
I`ve looked at Boost.Conversion library at sandbox/conversion/. The idea is interesting, but: 1) char ch = '0'; std::cout << boost::lexical_cast<int>(ch) << " " << boost::numeric_cast<int>(ch); This code will output "0 48" We can not make your library output both values... There are some tags, but in both cases it will be boost::dummy::type_tag<char> (or may be I didn`t get the idea) 2) For each conversation user will need to write convert_to<required_type> function overload. It will be much better, if user was required to write only one conversion function (to some intermediate type), and the library will be able to convert to any other type from intermediate type. I use lexical_cast<>() a lot, so I`d better improve it first.
participants (1)
-
Antony Polukhin