Skip to content

Commit

Permalink
Replace require_single_type with static_assert
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacy2012 committed Jan 29, 2024
1 parent 1902bb8 commit b8b59f0
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions include/flux/op/cartesian_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,6 @@ enum class read_kind { tuple, map };
template <typename B0, typename...>
inline constexpr bool cartesian_is_bounded = bounded_sequence<B0>;

template<typename... Ts>
struct require_single_type {
};

template<typename T>
struct require_single_type<T> {
using type = T;
};

template<typename... Ts>
using require_single_type_t = typename require_single_type<Ts...>::type;

template <typename T, std::size_t RepeatCount>
struct tuple_repeated {
template <std::size_t I>
Expand Down Expand Up @@ -222,7 +210,8 @@ struct cartesian_traits_base_impl {
{
auto base_cur = flux::first(self.base_);
return [&base_cur]<std::size_t... Is>(std::index_sequence<Is...>) {
std::array<cursor_t<require_single_type_t<Bases...>>, Arity> cur = {(static_cast<void>(Is), base_cur)...};
static_assert(sizeof...(Bases) == 1);
std::array<cursor_t<Bases>..., Arity> cur = {(static_cast<void>(Is), base_cur)...};
return cur;
}(std::make_index_sequence<Arity>{});
}
Expand Down

0 comments on commit b8b59f0

Please sign in to comment.