[build] more msys

This commit is contained in:
Timothy Stack 2022-06-04 00:03:52 -07:00
parent 023c9568d8
commit adf8f77e30
2 changed files with 18 additions and 9 deletions

View File

@ -90,13 +90,19 @@ invoke(Fn&& f, Args&&... args) noexcept(
template<class F, class... Args>
struct is_invocable {
template<class U>
static auto test(U* p)
-> decltype((*p)(std::declval<Args>()...), void(), std::true_type());
template<class U>
template<typename U, typename Obj, typename... FuncArgs>
static auto test(U&& p)
-> decltype((std::declval<Obj>().*p)(std::declval<FuncArgs>()...),
void(),
std::true_type());
template<typename U, typename... FuncArgs>
static auto test(U* p) -> decltype((*p)(std::declval<FuncArgs>()...),
void(),
std::true_type());
template<typename U, typename... FuncArgs>
static auto test(...) -> decltype(std::false_type());
static constexpr bool value = decltype(test<F>(0))::value;
static constexpr bool value = decltype(test<F, Args...>(0))::value;
};
} // namespace func

View File

@ -533,10 +533,11 @@ operator|(nonstd::optional<T> in,
template<typename T, typename F>
auto
operator|(const T& in, const lnav::itertools::details::mapper<F>& mapper)
-> std::vector<decltype(mapper.m_func(typename T::value_type{}))>
-> std::vector<
decltype(mapper.m_func(std::declval<typename T::value_type>()))>
{
using return_type
= std::vector<decltype(mapper.m_func(typename T::value_type{}))>;
using return_type = std::vector<decltype(mapper.m_func(
std::declval<typename T::value_type>()))>;
return_type retval;
retval.reserve(in.size());
@ -605,7 +606,9 @@ operator|(const std::vector<std::shared_ptr<T>>& in,
return retval;
}
template<typename T, typename F>
template<typename T,
typename F,
std::enable_if_t<!lnav::func::is_invocable<F, T>::value, int> = 0>
auto
operator|(const std::vector<T>& in,
const lnav::itertools::details::mapper<F>& mapper)