Scnlib Versions Save

scanf for modern C++

v0.4

3 years ago

Planned to be the last 0.x release before 1.0-rc1.

Changes and removals

  • Rework source range handling:
    • Non-views are now accepted as source ranges -- this includes types like std::string and std::vector<char>
    • Non-reconstructible ranges are now also accepted -- scanning functions no longer return a reconstructed source range. The member function .range() can be used to scan the range again, and .reconstruct() reconstructs the range, if possible. Other helper member functions are also available.
    • Source ranges are now either taken by const lvalue reference or rvalue reference, so they are no longer modified by scanning functions. To access the leftover range, use the return value of the scanning function.
  • Rewrite file handling, with hopefully way less bugs this time around
    • Remove file_view and caching ranges
    • Move memory mapped files to the public API
  • Remove default_tag, replace with scan_default function template
  • Remove support for scanf syntax, including scn::scanf and scn::basic_scanf_parse_context.
  • Improve Ranges integration:
    • Move custom Ranges implementation to the public API (out from scn::detail::ranges): scn::custom_ranges
    • Integrate standard library Ranges, if available: scn::std_ranges aliased to std::ranges
    • Use stdlib Ranges, if available, fall back to custom implementation: namespace alias scn::ranges, control behavior with SCN_USE_STD_RANGES

Additions

  • Add more thorough documentation, tests, benchmarks and examples
  • Add scan_list_until

Fixes and minor stuff

v0.3

4 years ago

Largely a bugfix release

Changes

  • Remove support for partial successes
    • If the reading of any of the arguments given to scan fail, the whole function fails
    • read-field removed from result
  • Overhaul list scanning
    • Add scan_list

Fixes

  • Fix issues with std::string_view and MSVC debug iterators (#11, #14, #18, #20)
  • Fix some issues with scanning customized types (#15)
  • Add missing support for custom-allocator std::strings (#16)
  • Fix erroneous git command in README (#13)
  • Fix README example
  • Fix erroneous usage of library feature test macros

Thanks to @nanoric and @SuperWig for bug reports!

Removals

  • Remove support for non-std::char_traits std::strings
  • Remove support for clang 3.6

v0.2

4 years ago

There are so many changes, that writing a complete changelog isn't really possible. The most substantial change is the removal of streams, which have been replaced with C++20-like ranges. There are also some pretty sweet performance improvements; see benchmarks in README for more details.

See the documentation for more details, a tutorial, and an API reference.

v0.1.2

4 years ago
  • Add SCN_RANGES CMake option
  • Add scn::temp helper function
  • Fix -Wpadded warnings on clang
  • Fix -Wfloat-equal and -Wconversion warnings on gcc
  • Fix C4146 error on UWP MSVC
  • Add CONTRIBUTING.md

v0.1.1

4 years ago

Quick bugfix release

  • Add more examples
  • Fix #8: Fix segfault when using scn::cstdin() or scn::wcstdin(), caused by the copy and move constructor of small_vector setting data pointer to nullptr if copying/moving from an empty small_vector. (Thanks @SuperWig for reporting!)
  • Fix compilation error when using scn::ranges::get_value.
  • Fix a badge in README (thanks @p1v0t)

v0.1

4 years ago

First release!