Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
is_copy_assignable.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_IS_COPY_ASSIGNABLE_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_COPY_ASSIGNABLE_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
14#include "stdlib/include/stdlib_detail/integral_constant.hpp"
15#include "stdlib/include/stdlib_detail/is_assignable.hpp"
16#include "stdlib/include/stdlib_detail/is_referenceable.hpp"
17
18namespace std {
20/// @brief Type trait to detect if an instance of @c T is copy assignable
21/// @tparam T The type of the value to check
22template <typename T, bool = internal::is_referenceable_v<T>>
23extern constexpr bool is_copy_assignable_v = false;
24
25/// @brief Type trait to detect if an instance of @c T is copy assignable
26/// @tparam T The type of the value to check
27template <typename T>
28extern constexpr bool is_copy_assignable_v<T, true> = is_assignable_v<T&, T const&>;
29
30/// @brief Type trait to detect if an instance of @c T is copy assignable without throwing
31/// @tparam T The type of the value to check
32template <typename T, bool = internal::is_referenceable_v<T>>
33extern constexpr bool is_nothrow_copy_assignable_v = false;
34
35/// @brief Type trait to detect if an instance of @c T is copy assignable without throwing
36/// @tparam T The type of the value to check
37template <typename T>
38extern constexpr bool is_nothrow_copy_assignable_v<T, true> = is_nothrow_assignable_v<T&, T const&>;
39
40/// @brief Type trait to detect if an instance of @c T is copy assignable without throwing
41/// @tparam T The type of the value to check
42template <typename T, bool = internal::is_referenceable_v<T>>
43extern constexpr bool is_trivially_copy_assignable_v = false;
44
45/// @brief Type trait to detect if an instance of @c T is copy assignable without throwing
46/// @tparam T The type of the value to check
47template <typename T>
48extern constexpr bool is_trivially_copy_assignable_v<T, true> = __is_trivially_assignable(T&, T const&);
49} // namespace is_copy_assignable_detail
50
51/// @brief Type trait to detect if an instance of @c T is copy assignable
52/// @tparam T The type of the value to check
53template <typename T>
55
56/// @brief Type trait to detect if an instance of @c T is copy assignable
57/// @tparam T The type of the value to check
58template <typename T>
60
61/// @brief Type trait to detect if an instance of @c T is copy assignable without throwing
62/// @tparam T The type of the value to check
63template <typename T>
65
66/// @brief Type trait to detect if an instance of @c T is copy assignable without throwing
67/// @tparam T The type of the value to check
68template <typename T>
70
71/// @brief Type trait to detect if an instance of @c T is trivially copy assignable
72/// @tparam T The type of the value to check
73template <typename T>
75
76/// @brief Type trait to detect if an instance of @c T is trivially copy assignable
77/// @tparam T The type of the value to check
78template <typename T>
80
81} // namespace std
82
83#endif // INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_COPY_ASSIGNABLE_HPP_
Type trait to detect if an instance of T is copy assignable.
Definition is_copy_assignable.hpp:59
Type trait to detect if an instance of T is copy assignable without throwing.
Definition is_copy_assignable.hpp:69
Type trait to detect if an instance of T is trivially copy assignable.
Definition is_copy_assignable.hpp:79
Definition is_copy_assignable.hpp:19
constexpr bool is_nothrow_copy_assignable_v
Type trait to detect if an instance of T is copy assignable without throwing.
constexpr bool is_trivially_copy_assignable_v
Type trait to detect if an instance of T is trivially copy assignable.
constexpr bool is_copy_assignable_v
Type trait to detect if an instance of T is copy assignable.
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