Skip to content

Commit

Permalink
Fixing compilation on GCC 11.x
Browse files Browse the repository at this point in the history
  • Loading branch information
flamewing committed Oct 10, 2023
1 parent 1cacd76 commit 593882e
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions include/mdcomp/stream_utils.hh
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,19 @@ namespace detail {

template <typename Fn, typename... Types>
class range_closure : public pipe::base<range_closure<Fn, Types...>> {
private:
template <typename SelfTy, typename Ty, size_t... Idx>
constexpr static decltype(auto)
call(SelfTy&& self, Ty&& arg, std::index_sequence<Idx...>) noexcept(
noexcept(Fn{}(
std::forward<Ty>(arg),
std::get<Idx>(std::forward<SelfTy>(self).captures)...))) {
static_assert(std::same_as<std::index_sequence<Idx...>, indices>);
return Fn{}(
std::forward<Ty>(arg),
std::get<Idx>(std::forward<SelfTy>(self).captures)...);
}

public:
// We assume that Fn is the type of a customization point object. That means
// 1. The behavior of operator() is independent of cvref qualifiers, so we can use
Expand Down Expand Up @@ -231,18 +244,6 @@ namespace detail {
}

private:
template <typename SelfTy, typename Ty, size_t... Idx>
constexpr static decltype(auto)
call(SelfTy&& self, Ty&& arg, std::index_sequence<Idx...>) noexcept(
noexcept(Fn{}(
std::forward<Ty>(arg),
std::get<Idx>(std::forward<SelfTy>(self).captures)...))) {
static_assert(std::same_as<std::index_sequence<Idx...>, indices>);
return Fn{}(
std::forward<Ty>(arg),
std::get<Idx>(std::forward<SelfTy>(self).captures)...);
}

std::tuple<Types...> captures;
};

Expand Down

0 comments on commit 593882e

Please sign in to comment.