From b8b59f0ab3f9c14c487dc6c94e01090a513e7615 Mon Sep 17 00:00:00 2001 From: Isaac Young Date: Tue, 30 Jan 2024 05:36:53 +1300 Subject: [PATCH] Replace require_single_type with static_assert --- include/flux/op/cartesian_base.hpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/include/flux/op/cartesian_base.hpp b/include/flux/op/cartesian_base.hpp index f76352d8..7ab3d371 100644 --- a/include/flux/op/cartesian_base.hpp +++ b/include/flux/op/cartesian_base.hpp @@ -16,18 +16,6 @@ enum class read_kind { tuple, map }; template inline constexpr bool cartesian_is_bounded = bounded_sequence; -template -struct require_single_type { -}; - -template -struct require_single_type { - using type = T; -}; - -template -using require_single_type_t = typename require_single_type::type; - template struct tuple_repeated { template @@ -222,7 +210,8 @@ struct cartesian_traits_base_impl { { auto base_cur = flux::first(self.base_); return [&base_cur](std::index_sequence) { - std::array>, Arity> cur = {(static_cast(Is), base_cur)...}; + static_assert(sizeof...(Bases) == 1); + std::array..., Arity> cur = {(static_cast(Is), base_cur)...}; return cur; }(std::make_index_sequence{}); }