|
Boost : |
From: Terje Slettebø (tslettebo_at_[hidden])
Date: 2003-01-03 16:15:18
> from previous thread RE: [boost] lexical_cast "Future directions"
> RE: [boost] lexical_cast "Future directions"
>
> > > A proposition has been made to fix this and other things
> > > (http://groups.yahoo.com/group/boost/files/lexical_cast_proposition/),
>
> I was quite interested in this proposition, as I wanted to use
lexical_cast
> with wide characters.
> I'm using MSVC 6.0.
>
> When running the supplied test suite, the following line is reported as
> failing:
> test<wchar_t,int>::do_test(L' ',123,__LINE__,true);
>
> output:
> Test - Failed (line 378) (Should have thrown exception)
> Source type = int (123)
> Destination type = unsigned short (49)
>
> The result is the first digit of the supplied int.
>
> I did not see this mentioned in the file's comments, nor could I find
> mention of it in the list archives, so I thought you should know.
Thanks for the report. I'll look into this. I'm currently redoing it quite a
bit, possibly to use function template overloading (like Daryle Walker
suggests in this posting
(http://aspn.activestate.com/ASPN/Mail/Message/1143265)), rather than the
current class template specialisation of a helper class, and I've been
discussing with Kevlin how to do it. That could make it easier to
user-extend it, as you might then overload the lexical_cast template (and
possibly call an existing function to do the conversion). Nevertheless, that
shouldn't affect this case.
The tests are also being redone to use the Boost unit test framework.
Although I must admit that the above printout is quite informative, as well.
:) However, using Boost.Test means I can replace the rather ad-hoc tests
there.
Regards,
Terje
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk