Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
is_copy_constructible.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_CONSTRUCTIBLE_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_COPY_CONSTRUCTIBLE_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_constructible.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 constructible
21/// @tparam T The type of the value to check
22template <typename T, bool = internal::is_referenceable_v<T>>
23extern constexpr bool is_copy_constructible_v = false;
24
25/// @brief Type trait to detect if an instance of @c T is copy constructible
26/// @tparam T The type of the value to check
27template <typename T>
28extern constexpr bool is_copy_constructible_v<T, true> = is_constructible_v<T, T const&>;
29
30/// @brief Type trait to detect if an instance of @c T is copy constructible 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_constructible_v = false;
34
35/// @brief Type trait to detect if an instance of @c T is copy constructible without throwing
36/// @tparam T The type of the value to check
37template <typename T>
38extern constexpr bool is_nothrow_copy_constructible_v<T, true> = is_nothrow_constructible_v<T, T const&>;
39
40/// @brief Type trait to detect if an instance of @c T is trivially copy constructible
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_constructible_v = false;
44
45/// @brief Type trait to detect if an instance of @c T is trivially copy constructible
46/// @tparam T The type of the value to check
47template <typename T>
48extern constexpr bool is_trivially_copy_constructible_v<T, true> = __is_trivially_constructible(T, T const&);
49
50} // namespace is_copy_constructible_detail
51
52/// @brief Type trait to detect if an instance of @c T is copy constructible
53/// @tparam T The type of the value to check
54template <typename T>
56
57/// @brief Type trait to detect if an instance of @c T is copy constructible
58/// @tparam T The type of the value to check
59template <typename T>
61
62/// @brief Type trait to detect if an instance of @c T is copy constructible without throwing
63/// @tparam T The type of the value to check
64template <typename T>
65extern constexpr bool is_nothrow_copy_constructible_v =
67
68/// @brief Type trait to detect if an instance of @c T is copy constructible without throwing
69/// @tparam T The type of the value to check
70template <typename T>
72
73/// @brief Type trait to detect if an instance of @c T is trivially copy constructible
74/// @tparam T The type of the value to check
75template <typename T>
76extern constexpr bool is_trivially_copy_constructible_v =
78
79/// @brief Type trait to detect if an instance of @c T is trivially copy constructible
80/// @tparam T The type of the value to check
81template <typename T>
83
84} // namespace std
85
86#endif // INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_COPY_CONSTRUCTIBLE_HPP_
Type trait to detect if an instance of T is copy constructible.
Definition is_copy_constructible.hpp:60
Type trait to detect if an instance of T is copy constructible without throwing.
Definition is_copy_constructible.hpp:71
Type trait to detect if an instance of T is trivially copy constructible.
Definition is_copy_constructible.hpp:82
Definition is_copy_constructible.hpp:19
constexpr bool is_trivially_copy_constructible_v
Type trait to detect if an instance of T is trivially copy constructible.
constexpr bool is_copy_constructible_v
Type trait to detect if an instance of T is copy constructible.
constexpr bool is_nothrow_copy_constructible_v
Type trait to detect if an instance of T is copy constructible without throwing.
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