mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-06 16:56:57 +08:00
additional improve for debug runtime.
This commit is contained in:
parent
a4d1174d2e
commit
e71bfff4a3
@ -68,20 +68,20 @@ using from_chars_result = from_chars_result_t<char>;
|
|||||||
|
|
||||||
template <typename UC> struct parse_options_t {
|
template <typename UC> struct parse_options_t {
|
||||||
FASTFLOAT_CONSTEXPR20 explicit parse_options_t(
|
FASTFLOAT_CONSTEXPR20 explicit parse_options_t(
|
||||||
chars_format fmt = chars_format::general, UC dot = UC('.'),
|
chars_format const fmt = chars_format::general, UC const dot = UC('.'),
|
||||||
int const b = 10) noexcept
|
int const b = 10) noexcept
|
||||||
: format(fmt), decimal_point(dot), base(uint8_t(b)) {
|
: format(fmt), decimal_point(dot), base(uint8_t(b)) {
|
||||||
#ifdef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
|
#ifdef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
|
||||||
assert(b >= 2 && b <= 36);
|
//static_assert(b >= 2 && b <= 36);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Which number formats are accepted */
|
/** Which number formats are accepted */
|
||||||
chars_format format;
|
chars_format const format;
|
||||||
/** The character used as decimal point */
|
/** The character used as decimal point */
|
||||||
UC decimal_point;
|
UC const decimal_point;
|
||||||
/** The base used for integers */
|
/** The base used for integers */
|
||||||
uint8_t base; /* only allowed from 2 to 36 */
|
uint8_t const base; /* only allowed from 2 to 36 */
|
||||||
FASTFLOAT_ASSUME(base >= 2 && base <= 36);
|
FASTFLOAT_ASSUME(base >= 2 && base <= 36);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -312,7 +312,7 @@ from_chars_float_advanced(UC const *first, UC const *last, T &value,
|
|||||||
#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
|
#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
|
||||||
if (uint8_t(options.format & chars_format::skip_white_space)) {
|
if (uint8_t(options.format & chars_format::skip_white_space)) {
|
||||||
while ((first != last) && fast_float::is_space(*first)) {
|
while ((first != last) && fast_float::is_space(*first)) {
|
||||||
first++;
|
++first;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (first == last) {
|
if (first == last) {
|
||||||
@ -375,7 +375,7 @@ from_chars_int_advanced(UC const *first, UC const *last, T &value,
|
|||||||
#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
|
#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
|
||||||
if (uint8_t(options.format & chars_format::skip_white_space)) {
|
if (uint8_t(options.format & chars_format::skip_white_space)) {
|
||||||
while ((first != last) && fast_float::is_space(*first)) {
|
while ((first != last) && fast_float::is_space(*first)) {
|
||||||
first++;
|
++first;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (first == last || options.base < 2 || options.base > 36) {
|
if (first == last || options.base < 2 || options.base > 36) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user