From 39ead1ddbd414cea22f742ccab1600da7bfee3ec Mon Sep 17 00:00:00 2001 From: Isaac Young <50868057+isaacy2012@users.noreply.github.com> Date: Tue, 30 Jan 2024 03:00:26 +1300 Subject: [PATCH 1/2] Fix FLUX_EXPORT for cartesian_power_map Co-authored-by: Tristan Brindle --- include/flux/op/cartesian_power_map.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/flux/op/cartesian_power_map.hpp b/include/flux/op/cartesian_power_map.hpp index c2f8eb02..f41e3296 100644 --- a/include/flux/op/cartesian_power_map.hpp +++ b/include/flux/op/cartesian_power_map.hpp @@ -55,8 +55,10 @@ struct cartesian_power_map_fn } // namespace detail -template -FLUX_EXPORT inline constexpr auto cartesian_power_map = detail::cartesian_power_map_fn{}; +FLUX_EXPORT +template + requires (N >= 0) +inline constexpr auto cartesian_power_map = detail::cartesian_power_map_fn{}; } // namespace flux From 91903c27eea46e09e1eb86cf526ad8b4e7822ff8 Mon Sep 17 00:00:00 2001 From: Isaac Young <50868057+isaacy2012@users.noreply.github.com> Date: Tue, 30 Jan 2024 03:00:59 +1300 Subject: [PATCH 2/2] Refactor cartesian_product_adaptor and traits ordering Co-authored-by: Tristan Brindle --- include/flux/op/cartesian_product.hpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/include/flux/op/cartesian_product.hpp b/include/flux/op/cartesian_product.hpp index 360ba25e..5a825aca 100644 --- a/include/flux/op/cartesian_product.hpp +++ b/include/flux/op/cartesian_product.hpp @@ -26,6 +26,10 @@ struct cartesian_product_adaptor FLUX_NO_UNIQUE_ADDRESS std::tuple bases_; public: + constexpr explicit cartesian_product_adaptor(decays_to auto&&... bases) + : bases_(FLUX_FWD(bases)...) + {} + using flux_sequence_traits = cartesian_traits_base< sizeof...(Bases), cartesian_kind::product, @@ -33,12 +37,6 @@ struct cartesian_product_adaptor Bases... >; friend flux_sequence_traits::impl; - - constexpr explicit cartesian_product_adaptor(decays_to auto&&... bases) - : bases_(FLUX_FWD(bases)...) - {} - - }; struct cartesian_product_fn {