Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
tuple_size.hpp
Go to the documentation of this file.
1
// Copyright 2026, Toyota Motor Corporation
2
//
3
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5
#
ifndef
INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_TUPLE_SIZE_HPP_
6
#
define
INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_TUPLE_SIZE_HPP_
7
8
// IWYU pragma: private, include <tuple>
9
// IWYU pragma: friend "stdlib_detail/.*"
10
11
// parasoft-begin-suppress CERT_CPP-DCL58-a-2 "Part of a standard library implementation"
12
// parasoft-begin-suppress AUTOSAR-A17_6_1-a-2 "Part of a standard library implementation"
13
14
#
include
"stdlib/include/stdlib_detail/cstddef.hpp"
15
16
namespace
std
{
17
18
/// @brief obtain the number of elements in a tuple-like type
19
/// @tparam T tuple like type
20
///
21
template
<
class
T>
22
class
tuple_size;
// undefined
23
24
/// @brief obtain the number of elements in a tuple-like type
25
/// @tparam T tuple like type
26
///
27
/// Specialization for @c const qualified @c T.
28
///
29
template
<
class
T>
30
class
tuple_size<T
const
> :
public
tuple_size<T> {};
31
32
// parasoft-begin-suppress AUTOSAR-A2_11_1-a "This type trait is required to add volatile"
33
34
/// @brief obtain the number of elements in a tuple-like type
35
/// @tparam T tuple like type
36
///
37
/// Specialization for @c volatile qualified @c T.
38
///
39
template
<
class
T>
40
class
tuple_size<T
volatile
> :
public
tuple_size<T> {};
41
42
/// @brief obtain the number of elements in a tuple-like type
43
/// @tparam T tuple like type
44
///
45
/// Specialization for @c const and @c volatile qualified @c T.
46
///
47
template
<
class
T>
48
class
tuple_size<T
const
volatile
> :
public
tuple_size<T> {};
49
50
// parasoft-end-suppress AUTOSAR-A2_11_1-a
51
52
/// @brief obtain the number of elements in a tuple-like type
53
/// @tparam T tuple like type
54
///
55
// NOTE: While most type traits in this 'std' implementation use _v as the source of truth,
56
// @c tuple_size_v is based on @c tuple_size as types (including user-defined types) are
57
// expected to provide specializations of @c tuple_size.
58
template
<
class
T
>
59
extern
constexpr
std
::
size_t
tuple_size_v
{
tuple_size
<
T
>::
value
};
60
61
}
// namespace std
62
63
#
endif
// INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_TUPLE_SIZE_HPP_
std::tuple_size_v
constexpr std::size_t tuple_size_v
obtain the number of elements in a tuple-like type
std::hash<::arene::base::result< void, E > >::operator()
constexpr auto operator()(::arene::base::result< void, E > const &value) const noexcept(noexcept(hash< E >{}(std::declval< E const & >()))) -> std::size_t
Calculate the hash of a result.
Definition
result.hpp:1827
stdlib
include
stdlib_detail
tuple_size.hpp
Generated by
1.13.2