From a7a2c97383f2d1a467865e2d5fa866996b1c35d5 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 19 Mar 2020 16:31:52 +0200 Subject: [PATCH] Document mp_power_set --- doc/mp11/algorithm.adoc | 14 ++++++++++++++ doc/mp11/changelog.adoc | 1 + 2 files changed, 15 insertions(+) diff --git a/doc/mp11/algorithm.adoc b/doc/mp11/algorithm.adoc index 39669d8..ef7aa6a 100644 --- a/doc/mp11/algorithm.adoc +++ b/doc/mp11/algorithm.adoc @@ -284,6 +284,20 @@ It returns a list of the form `L1` containing the results of the applicati As `mp_product`, but takes a quoted metafunction. +## mp_power_set + + template using mp_power_set = /*...*/; + +`mp_power_set` returns a list (of the same form as `L`) of all possible 2^n^ subsets of `L` (where `n` is the length of `L`.) + +`mp_power_set>` returns `L>`. + +`mp_power_set>` returns `L, L>`. + +`mp_power_set>` returns `L, L, L, L>`. + +`mp_power_set>` returns the concatenation of `mp_power_set>` and that same list with `T1` prepended to each element. + ## mp_drop_c template using mp_drop_c = /*...*/; diff --git a/doc/mp11/changelog.adoc b/doc/mp11/changelog.adoc index e64ae54..76c2ade 100644 --- a/doc/mp11/changelog.adoc +++ b/doc/mp11/changelog.adoc @@ -16,6 +16,7 @@ http://www.boost.org/LICENSE_1_0.txt * Added `mp_flatten` * Added `mp_rotate_left`, `mp_rotate_right` (contributed by Duncan Barber) * Added `mp_compose` +* Added `mp_power_set` ## Changes in 1.70.0