4.0.0
Breaking changes
scanner::parse
now returnsIterator
, notscan_expected<Iterator>
- Errors are reported by throwing a
scan_format_string_error
, or by callingParseContext::on_error
.
- Errors are reported by throwing a
- Optimize the way
scan
callsvscan
to remove extra copies/moves
// Dummy-implementation of `scan`
// Before (v3):
auto args = make_scan_args<scan_context, Args...>();
auto result = vscan(std::forward<Source>(source), format, args);
return make_scan_result(std::move(result), std::move(args.args()));
// Now (v4):
auto result = make_scan_result<Source, Args...>();
fill_scan_result(result, vscan(std::forward<Source>(source), format,
make_scan_args(result->values())));
return result;
- Changes to
scan_error
- Success state removed: use
expected<void, scan_error>
instead. scan_error::value_out_of_range
split intovalue_positive_overflow
,value_negative_overflow
,
value_positive_underflow
, andvalue_negative_overflow
.end_of_range
renamed toend_of_input
.invalid_literal
,invalid_fill
,length_too_short
, andinvalid_source_state
added.
- Success state removed: use
basic_scan_context
is now templated on the range type
Features
<chrono>
scanning- Scanning of pointers (
void*
andconst void*
) - Ability to disable dependency on FastFloat with
SCN_DISABLE_FAST_FLOAT
- FastFloat used to be the only required external dependency
- If disabled,
std::from_chars
for floating-point values is required
Changes
- Deprecate
visit_scan_arg
, addbasic_scan_arg::visit
- Remove thousands separator checking when scanning localized numbers
scan_error::invalid_source_state
is now returned if syncing with the underlying source fails afterscan
(like for example,std::ungetc
fails)
Full Changelog: v3.0.2...v4.0.0