| | |
| | | #include <type_traits> |
| | | #include <utility> |
| | | |
| | | #if __cplusplus < 201703L |
| | | #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) |
| | | |
| | | template <class F, class Tuple> |
| | | inline constexpr decltype(auto) apply_tuple(F&& f, Tuple&& t) |
| | | { |
| | | return std::apply(std::forward<F>(f), std::forward<Tuple>(t)); |
| | | } |
| | | |
| | | #else |
| | | |
| | | namespace detail |
| | | { |
| | |
| | | return detail::apply< std::tuple_size< |
| | | typename std::decay<T>::type |
| | | >::value>::apply_tuple(std::forward<F>(f), std::forward<T>(t)); |
| | | } |
| | | |
| | | #else |
| | | |
| | | template <class F, class Tuple> |
| | | inline constexpr decltype(auto) apply_tuple(F&& f, Tuple&& t) |
| | | { |
| | | return std::apply(std;:forward<F>(f), std::forward<Tuple>(t)); |
| | | } |
| | | |
| | | #endif // C++17 |