// -*- C++ -*- //===----------------------------- tuple ----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef _LIBCPP_EXPERIMENTAL_TUPLE #define _LIBCPP_EXPERIMENTAL_TUPLE /* experimental/tuple synopsis // C++1y #include namespace std { namespace experimental { inline namespace fundamentals_v1 { // See C++14 20.4.2.5, tuple helper classes template constexpr size_t tuple_size_v = tuple_size::value; // 3.2.2, Calling a function with a tuple of arguments template constexpr decltype(auto) apply(F&& f, Tuple&& t); } // namespace fundamentals_v1 } // namespace experimental } // namespace std */ # include #if _LIBCPP_STD_VER > 11 # include # include # include <__functional_base> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_LFTS #ifndef _LIBCPP_HAS_NO_VARIABLE_TEMPLATES template _LIBCPP_CONSTEXPR size_t tuple_size_v = tuple_size<_Tp>::value; #endif template inline _LIBCPP_INLINE_VISIBILITY decltype(auto) __apply_tuple_impl(_Fn && __f, _Tuple && __t, integer_sequence) { return _VSTD::__invoke( _VSTD::forward<_Fn>(__f), _VSTD::get<_Id>(_VSTD::forward<_Tuple>(__t))... ); } template inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 decltype(auto) apply(_Fn && __f, _Tuple && __t) { return _VSTD_LFTS::__apply_tuple_impl( _VSTD::forward<_Fn>(__f), _VSTD::forward<_Tuple>(__t), make_index_sequence::type>::value>() ); } _LIBCPP_END_NAMESPACE_LFTS #endif /* _LIBCPP_STD_VER > 11 */ #endif /* _LIBCPP_EXPERIMENTAL_TUPLE */