Skip to content

Commit

Permalink
Slightly simplify cartesian_base sequence impls
Browse files Browse the repository at this point in the history
  • Loading branch information
tcbrindle committed Aug 20, 2024
1 parent 5b1d9a4 commit 4bb55a8
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions include/flux/op/cartesian_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,23 +328,15 @@ struct cartesian_traits_base_impl : default_sequence_traits {
-> decltype(auto)
requires (ReadKind == read_kind::map)
{
if constexpr (std::is_lvalue_reference_v<decltype(read_at(self, cur))>) {
return std::move(read_at(self, cur));
} else {
return read_at(self, cur);
}
return default_sequence_traits::move_at(self, cur);
}

template <typename Self>
static constexpr auto move_at_unchecked(Self& self, cursor_t<Self> const& cur)
-> decltype(auto)
requires (ReadKind == read_kind::map)
{
if constexpr (std::is_lvalue_reference_v<decltype(read_at_unchecked(self, cur))>) {
return std::move(read_at_unchecked(self, cur));
} else {
return read_at_unchecked(self, cur);
}
return default_sequence_traits::move_at_unchecked(self, cur);
}

template <typename Self>
Expand Down

0 comments on commit 4bb55a8

Please sign in to comment.