ELF: Have __rela_iplt_{start,end} surround .rela.iplt with --pack-dyn-relocs=android.
[llvm-project.git] / libcxx / include / __cxx03 / __tuple / tuple_size.h
blobada7a522182e29fd9ace3b48c75f4b2001f9a534
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 //===----------------------------------------------------------------------===//
9 #ifndef _LIBCPP___TUPLE_TUPLE_SIZE_H
10 #define _LIBCPP___TUPLE_TUPLE_SIZE_H
12 #include <__cxx03/__config>
13 #include <__cxx03/__fwd/tuple.h>
14 #include <__cxx03/__tuple/tuple_types.h>
15 #include <__cxx03/__type_traits/is_const.h>
16 #include <__cxx03/__type_traits/is_volatile.h>
17 #include <__cxx03/cstddef>
19 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
20 # pragma GCC system_header
21 #endif
23 _LIBCPP_BEGIN_NAMESPACE_STD
25 template <class _Tp>
26 struct _LIBCPP_TEMPLATE_VIS tuple_size;
28 #if !defined(_LIBCPP_CXX03_LANG)
29 template <class _Tp, class...>
30 using __enable_if_tuple_size_imp = _Tp;
32 template <class _Tp>
33 struct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp< const _Tp,
34 __enable_if_t<!is_volatile<_Tp>::value>,
35 integral_constant<size_t, sizeof(tuple_size<_Tp>)>>>
36 : public integral_constant<size_t, tuple_size<_Tp>::value> {};
38 template <class _Tp>
39 struct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp< volatile _Tp,
40 __enable_if_t<!is_const<_Tp>::value>,
41 integral_constant<size_t, sizeof(tuple_size<_Tp>)>>>
42 : public integral_constant<size_t, tuple_size<_Tp>::value> {};
44 template <class _Tp>
45 struct _LIBCPP_TEMPLATE_VIS
46 tuple_size<__enable_if_tuple_size_imp<const volatile _Tp, integral_constant<size_t, sizeof(tuple_size<_Tp>)>>>
47 : public integral_constant<size_t, tuple_size<_Tp>::value> {};
49 #else
50 template <class _Tp>
51 struct _LIBCPP_TEMPLATE_VIS tuple_size<const _Tp> : public tuple_size<_Tp> {};
52 template <class _Tp>
53 struct _LIBCPP_TEMPLATE_VIS tuple_size<volatile _Tp> : public tuple_size<_Tp> {};
54 template <class _Tp>
55 struct _LIBCPP_TEMPLATE_VIS tuple_size<const volatile _Tp> : public tuple_size<_Tp> {};
56 #endif
58 #ifndef _LIBCPP_CXX03_LANG
60 template <class... _Tp>
61 struct _LIBCPP_TEMPLATE_VIS tuple_size<tuple<_Tp...> > : public integral_constant<size_t, sizeof...(_Tp)> {};
63 template <class... _Tp>
64 struct _LIBCPP_TEMPLATE_VIS tuple_size<__tuple_types<_Tp...> > : public integral_constant<size_t, sizeof...(_Tp)> {};
66 # if _LIBCPP_STD_VER >= 17
67 template <class _Tp>
68 inline constexpr size_t tuple_size_v = tuple_size<_Tp>::value;
69 # endif
71 #endif // _LIBCPP_CXX03_LANG
73 _LIBCPP_END_NAMESPACE_STD
75 #endif // _LIBCPP___TUPLE_TUPLE_SIZE_H