https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110824

--- Comment #2 from Denis Yaroshevskiy <denis.yaroshevskij at gmail dot com> ---
FYI, this is my workaround:

```

template<typename Selector> struct just_shuffle_test_selector
{
  Selector sel;

  template<typename... Args>
  auto operator()(Args... args) const
  requires(std::invocable<Selector, Args...>)
  {
    auto r = sel(args...);
    if constexpr( !eve::detail::matched_shuffle<decltype(r)> )
    {
      return kumi::tuple {r, eve::index<-1>};
    }
    else return kumi::tuple {r, eve::index<0>};
  }
};

template<typename Selector>
just_shuffle_test_selector(Selector) -> just_shuffle_test_selector<Selector>;

template<typename WrappedShuffleV2> struct just_shuffle_test_
{
  WrappedShuffleV2 sh2;


  template<typename... Args>
  auto operator()(Args... args) const
  requires(std::invocable<WrappedShuffleV2, Args...>)
  {
    return get<0>(sh2(args...));
  }
};

template<typename WrappedShuffleV2>
just_shuffle_test_(WrappedShuffleV2) -> just_shuffle_test_<WrappedShuffleV2>;


template<typename Selector>
constexpr auto
just_shuffle_test(Selector selector)
{
  return
just_shuffle_test_{eve::detail::make_shuffle_v2(just_shuffle_test_selector{selector})};
}
```

Reply via email to