Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
add_cv.hpp
Go to the documentation of this file.
1// Copyright 2024, 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_ADD_CV_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_ADD_CV_HPP_
7
8// parasoft-begin-suppress CERT_CPP-DCL58-a-2 "Part of a standard library implementation"
9// parasoft-begin-suppress AUTOSAR-A17_6_1-a-2 "Part of a standard library implementation"
10
11// IWYU pragma: private, include <type_traits>
12// IWYU pragma: friend "stdlib_detail/.*"
13
14namespace std {
15/// @brief Add @c const and @c volatile to the provided type. The @c type member
16/// is an alias for the modified type.
17/// @tparam Type The type to add @c const and @c volatile to
18template <typename Type>
19class add_cv {
20 public:
21 // parasoft-begin-suppress AUTOSAR-A2_11_1-a "This type trait is required to add volatile"
22 /// @brief The resulting type
23 using type = Type const volatile;
24 // parasoft-end-suppress AUTOSAR-A2_11_1-a
25};
26
27/// @brief Add @c const and @c volatile to the provided type. An alias for the
28/// modified type.
29/// @tparam Type The type to add @c const and @c volatile to
30template <typename Type>
31using add_cv_t = typename add_cv<Type>::type;
32
33} // namespace std
34
35#endif // INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_ADD_CV_HPP_
Add const and volatile to the provided type. The type member is an alias for the modified type.
Definition add_cv.hpp:19
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