forked from boostorg/conversion
Merge from trunk:
* fixed #6812 (now converting "." to float type throws bad_lexical_cast) [SVN r78211]
This commit is contained in:
@@ -1062,9 +1062,10 @@ namespace boost {
|
||||
) return false;
|
||||
#endif
|
||||
|
||||
if(*begin == decimal_point){
|
||||
if(*begin == decimal_point) {
|
||||
++ begin;
|
||||
found_decimal = true;
|
||||
if (!found_number_before_exp && begin==end) return false;
|
||||
continue;
|
||||
}else {
|
||||
if (!found_number_before_exp) return false;
|
||||
|
@@ -261,6 +261,7 @@ void test_converion_to_float_types()
|
||||
BOOST_CHECK_THROW(lexical_cast<test_t>(".e"), bad_lexical_cast);
|
||||
BOOST_CHECK_THROW(lexical_cast<test_t>(".11111111111111111111111111111111111111111111111111111111111111111111ee"), bad_lexical_cast);
|
||||
BOOST_CHECK_THROW(lexical_cast<test_t>(".11111111111111111111111111111111111111111111111111111111111111111111e-"), bad_lexical_cast);
|
||||
BOOST_CHECK_THROW(lexical_cast<test_t>("."), bad_lexical_cast);
|
||||
|
||||
BOOST_CHECK_THROW(lexical_cast<test_t>("-B"), bad_lexical_cast);
|
||||
BOOST_CHECK_THROW(lexical_cast<test_t>("0xB"), bad_lexical_cast);
|
||||
@@ -276,6 +277,7 @@ void test_converion_to_float_types()
|
||||
BOOST_CHECK_THROW(lexical_cast<test_t>("-"), bad_lexical_cast);
|
||||
BOOST_CHECK_THROW(lexical_cast<test_t>('\0'), bad_lexical_cast);
|
||||
BOOST_CHECK_THROW(lexical_cast<test_t>('-'), bad_lexical_cast);
|
||||
BOOST_CHECK_THROW(lexical_cast<test_t>('.'), bad_lexical_cast);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
|
Reference in New Issue
Block a user