tuple_like_ext.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #ifndef _LIBCPP___TUPLE_TUPLE_LIKE_EXT_H
  9. #define _LIBCPP___TUPLE_TUPLE_LIKE_EXT_H
  10. #include <__config>
  11. #include <__fwd/array.h>
  12. #include <__fwd/pair.h>
  13. #include <__fwd/tuple.h>
  14. #include <__tuple/tuple_types.h>
  15. #include <__type_traits/integral_constant.h>
  16. #include <cstddef>
  17. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  18. # pragma GCC system_header
  19. #endif
  20. _LIBCPP_BEGIN_NAMESPACE_STD
  21. template <class _Tp>
  22. struct __tuple_like_ext : false_type {};
  23. template <class _Tp>
  24. struct __tuple_like_ext<const _Tp> : public __tuple_like_ext<_Tp> {};
  25. template <class _Tp>
  26. struct __tuple_like_ext<volatile _Tp> : public __tuple_like_ext<_Tp> {};
  27. template <class _Tp>
  28. struct __tuple_like_ext<const volatile _Tp> : public __tuple_like_ext<_Tp> {};
  29. #ifndef _LIBCPP_CXX03_LANG
  30. template <class... _Tp>
  31. struct __tuple_like_ext<tuple<_Tp...> > : true_type {};
  32. #endif
  33. template <class _T1, class _T2>
  34. struct __tuple_like_ext<pair<_T1, _T2> > : true_type {};
  35. template <class _Tp, size_t _Size>
  36. struct __tuple_like_ext<array<_Tp, _Size> > : true_type {};
  37. template <class... _Tp>
  38. struct __tuple_like_ext<__tuple_types<_Tp...> > : true_type {};
  39. _LIBCPP_END_NAMESPACE_STD
  40. #endif // _LIBCPP___TUPLE_TUPLE_LIKE_EXT_H