12 #ifndef __STOUT_CPP17_HPP__ 13 #define __STOUT_CPP17_HPP__ 34 #define RETURN(...) -> decltype(__VA_ARGS__) { return __VA_ARGS__; } 40 template <
typename F,
typename... As>
41 auto invoke(F&&
f, As&&... as)
44 template <typename B, typename T, typename D>
45 auto invoke(T B::*pmv, D&& d)
48 template <typename Pmv, typename Ptr>
49 auto invoke(Pmv pmv, Ptr&& ptr)
52 template <typename B, typename T, typename D, typename... As>
53 auto invoke(T B::*pmf, D&& d, As&&... as)
54 RETURN((
std::forward<D>(d).*pmf)(
std::forward<As>(as)...))
56 template <typename Pmf, typename Ptr, typename... As>
57 auto invoke(Pmf pmf, Ptr&& ptr, As&&... as)
58 RETURN(((*
std::forward<Ptr>(ptr)).*pmf)(
std::forward<As>(as)...))
65 #endif // __STOUT_CPP17_HPP__ F && f
Definition: defer.hpp:270
#define RETURN(...)
Definition: cpp17.hpp:34
Definition: type_utils.hpp:619