From d669ed844ca1fc356b1481a6b7e2a1d221715f4b Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 12 Mar 2021 06:25:43 +0200 Subject: [PATCH] Document mp_split --- doc/mp11/algorithm.adoc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/mp11/algorithm.adoc b/doc/mp11/algorithm.adoc index c59a55a..37e32f5 100644 --- a/doc/mp11/algorithm.adoc +++ b/doc/mp11/algorithm.adoc @@ -567,11 +567,23 @@ using R3 = mp_flatten; // mp_list> template using mp_intersperse = /*...*/; -Inserts the separator `S` between the elements of `L`. +Inserts the separator `S` between the elements of the list `L`. `mp_intersperse, S>` is `L<>`. `mp_intersperse, S>` is `L`. `mp_intersperse, S>` is `L`. +## mp_split + + template using mp_split = /*...*/; + +Splits the list `L` into segments at each separator `S` and returns a list of +the segments. + +`mp_split, S>` is `L>`. `mp_split, S>`, where `S` does not occur in `T...`, +is `L>`. `mp_split, S>` is `L, L, L>`. + +The segments may be empty; `mp_split, S>` is `L, L, L<>, L<>>`. + ## mp_partition template class P> using mp_partition = /*...*/;