Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
remove_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_REMOVE_CV_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_REMOVE_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
16// parasoft-begin-suppress AUTOSAR-A2_7_3-a "False positive: all declarations
17// and typedefs *are* preceded by a comment with @brief"
18
19// parasoft-begin-suppress AUTOSAR-A14_7_2-a-2 "False positive: All
20// 'remove_cv' specializations are declared in the same files as the
21// primary template"
22
23/// @brief The @c type member is an alias for @c T, but with top-level @c const and/or @c volatile qualifiers removed.
24/// @tparam T The type to remove the qualifiers from
25template <typename T>
26class remove_cv {
27 public:
28 /// @brief The resulting type
29 using type = T;
30};
31
32/// @brief The @c type member is an alias for @c T, but with top-level @c const and/or @c volatile qualifiers removed.
33/// @tparam T The type to remove the qualifiers from
34template <typename T>
35class remove_cv<T const> {
36 public:
37 /// @brief The resulting type
38 using type = T;
39};
40
41// parasoft-begin-suppress AUTOSAR-A2_11_1-a-2 "volatile used to to remove volatile qualifier"
42/// @brief The @c type member is an alias for @c T, but with top-level @c const and/or @c volatile qualifiers removed.
43/// @tparam T The type to remove the qualifiers from
44template <typename T>
45class remove_cv<T volatile> {
46 public:
47 /// @brief The resulting type
48 using type = T;
49};
50
51/// @brief The @c type member is an alias for @c T, but with top-level @c const and/or @c volatile qualifiers removed.
52/// @tparam T The type to remove the qualifiers from
53template <typename T>
54class remove_cv<T const volatile> {
55 public:
56 /// @brief The resulting type
57 using type = T;
58};
59// parasoft-end-suppress AUTOSAR-A2_11_1-a-2
60
61/// @brief An alias for @c T, but with top-level @c const and/or @c volatile qualifiers removed.
62/// @tparam T The type to remove the qualifiers from
63template <typename T>
64using remove_cv_t = typename remove_cv<T>::type;
65
66// parasoft-end-suppress AUTOSAR-A2_7_3-a
67// parasoft-end-suppress AUTOSAR-A14_7_2-a-2
68
69} // namespace std
70
71#endif // INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_REMOVE_CV_HPP_
The type member is an alias for T, but with top-level const and/or volatile qualifiers removed.
Definition remove_cv.hpp:26
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