Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#5732 closed Tasks (fixed)

small bugfixes and refactoring for lexical_cast

Reported by: Antony Polukhin Owned by: Antony Polukhin
Milestone: Boost 1.48.0 Component: lexical_cast
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

lexical_cast requires refactoring:

  • reduce templates count
  • leave only one lexical converting class (at least for modern compilers)
  • fix small TODOs and XXXs from source code
  • make lexical_stream_limited_src more readable
  • update status/explicit-failures-markup.xml

small bugs to fix:

  • make lexical_cast_inf_nan_test.cpp pass on Itanium pltform
  • make lexical_cast able to convert signed and unsigned chars to wchar_t and update lexical_cast_wchars_test

Attachments (1)

lex.tar.gz (20.0 KB ) - added by Jürgen Hunold 11 years ago.
testcase for std::vector<char>

Download all attachments as: .zip

Change History (13)

comment:1 by Antony Polukhin, 11 years ago

Resolution: fixed
Status: newclosed

(In [73313]) Fixes #5732.

  • reduces templates count
  • leaves only one lexical converting class (at least for modern compilers)
  • fixes small TODOs and XXXs from source code
  • makes lexical_stream_limited_src more readable
  • updates status/explicit-failures-markup.xml
  • makes lexical_cast_inf_nan_test.cpp pass on Itanium pltform
  • makes lexical_cast able to convert signed and unsigned chars to wchar_t and updates lexical_cast_wchars_test

comment:2 by Antony Polukhin, 11 years ago

(In [73323]) Fixes #5732.

  • fixes performance regression, that was added by previous commit
  • fixes float types preformance regression for old compilers

comment:3 by Antony Polukhin, 11 years ago

(In [73328]) Fixes #5732.

  • fixes some warnings and bugs for VC

by Jürgen Hunold, 11 years ago

Attachment: lex.tar.gz added

testcase for std::vector<char>

comment:4 by Jürgen Hunold, 11 years ago

the last patches broke some of my code which uses lexical_cast to parse values from std::vector<char>

Something as simple as

std::vector<char> buffer; return boost::lexical_cast<int>(&buffer[0]);

fails with

BOOST_ROOT/boost/lexical_cast.hpp:1091:43: error: no matching constructor for initialization of 'std::basic_ostream<char>'

std::basic_ostream<CharT> stream(&stringbuffer);

~

this is the start of the clang diagnostic.

Both gcc (Ubuntu 4.6.0-3~ppa1) 4.6.1 20110409 (prerelease) and clang version 3.0 (trunk 135897)

output contained in attached testcase lex.tar.gz

comment:5 by Antony Polukhin, 11 years ago

(In [73357]) Fixes #5732.

  • fixes compilation errors for nonconst char arrays

in reply to:  4 comment:6 by Antony Polukhin, 11 years ago

Replying to jhunold:

the last patches broke some of my code which uses lexical_cast to parse values from std::vector<char>

Fixed in [73357]. Added some test cases. Thanks again for the testing.

comment:7 by Antony Polukhin, 11 years ago

(In [73384]) Fixes #5732.

  • fixes compilation errors pgi compiler
  • fixes some bugs for MinGW compiler

comment:8 by Antony Polukhin, 11 years ago

(In [73401]) Fixes #5732.

  • one more try to fix compilation errors on pgi compiler

comment:9 by Antony Polukhin, 11 years ago

(In [73435]) Fixes #5732.

  • one more try to fix compilation errors on pgi compiler

comment:10 by Antony Polukhin, 11 years ago

(In [73446]) Fixes #5732.

  • at least compiles on pgi

comment:11 by Antony Polukhin, 11 years ago

(In [73601]) Fixes #5732.

  • some fixes for WinCE
  • updated explicit failures markup

comment:12 by Antony Polukhin, 11 years ago

(In [73640]) Fixes #5732.

  • suppress compilation warnings, if the compiler requires a return, even when it can never be reached
Note: See TracTickets for help on using tickets.