tcbrindle / flux

A C++20 library for sequence-orientated programming
https://tristanbrindle.com/flux/
Boost Software License 1.0
472 stars 29 forks source link

Make splitting more generic #141

Closed tcbrindle closed 8 months ago

tcbrindle commented 8 months ago

Rather than a pattern, split_adaptor now uses a "Splitter", a function object which, when passed a sequence, returns the bounds of the next slice.

This opens the door to potentially doing more sophisticated splitting, for example using a (CTRE?) regex or one of the standard library searchers.

At the moment, we don't publicly expose the generic Splitter interface, but this could be done in future. Rather, our existing split() overloads have been changed to use new (internal) pattern_splitter and delim_splitter implementations.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (c2be7c5) 97.71% compared to head (3daf890) 97.98%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #141 +/- ## ========================================== + Coverage 97.71% 97.98% +0.27% ========================================== Files 67 66 -1 Lines 2402 2380 -22 ========================================== - Hits 2347 2332 -15 + Misses 55 48 -7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.