Breaking changes
scanner::parsenow 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
scancallsvscanto 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_rangesplit intovalue_positive_overflow,value_negative_overflow,
value_positive_underflow, andvalue_negative_overflow.end_of_rangerenamed toend_of_input.invalid_literal,invalid_fill,length_too_short, andinvalid_source_stateadded.
- Success state removed: use
basic_scan_contextis 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_charsfor 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_stateis now returned if syncing with the underlying source fails afterscan
(like for example,std::ungetcfails)
Full Changelog: v3.0.2...v4.0.0