| 884 | |
| 885 | template<typename KeyIter, typename Sentinel> |
| 886 | match_result extend_subsequence_impl( |
| 887 | match_result prev, KeyIter & first, Sentinel last) const |
| 888 | { |
| 889 | if (to_node_ptr(prev.node) == &header_) { |
| 890 | if (header_.empty()) |
| 891 | return prev; |
| 892 | prev.node = header_.child(0); |
| 893 | } |
| 894 | |
| 895 | if (first == last) { |
| 896 | prev.match = !!to_node_ptr(prev.node)->value(); |
| 897 | prev.leaf = to_node_ptr(prev.node)->empty(); |
| 898 | return prev; |
| 899 | } |
| 900 | |
| 901 | node_t const * node = to_node_ptr(prev.node); |
| 902 | size_type size = prev.size; |
| 903 | while (first != last) { |
| 904 | auto const it = node->find(*first, comp_); |
| 905 | if (it == node->end()) |
| 906 | break; |
| 907 | ++first; |
| 908 | ++size; |
| 909 | node = it->get(); |
| 910 | } |
| 911 | |
| 912 | return match_result{node, size, !!node->value(), node->empty()}; |
| 913 | } |
| 914 | |
| 915 | static match_result back_up_to_match(match_result retval) |
| 916 | { |