| 2615 | |
| 2616 | template <typename pattern_> |
| 2617 | partition_type partition_(pattern_ &&pattern, std::size_t pattern_length) const noexcept { |
| 2618 | size_type pos = find(pattern); |
| 2619 | if (pos == npos) return {string_slice(*this), string_slice(), string_slice()}; |
| 2620 | return {string_slice(start_, pos), string_slice(start_ + pos, pattern_length), |
| 2621 | string_slice(start_ + pos + pattern_length, length_ - pos - pattern_length)}; |
| 2622 | } |
| 2623 | |
| 2624 | template <typename pattern_> |
| 2625 | partition_type rpartition_(pattern_ &&pattern, std::size_t pattern_length) const noexcept { |