Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
is_move_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_MOVE_CONSTRUCTIBLE_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_MOVE_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 move constructible
21/// @tparam T The type of the value to check
22template <typename T, bool = internal::is_referenceable_v<T>>
23extern constexpr bool is_move_constructible_v = false;
24
25/// @brief Type trait to detect if an instance of @c T is move constructible
26/// @tparam T The type of the value to check
27template <typename T>
28extern constexpr bool is_move_constructible_v<T, true> = is_constructible_v<T, T&&>;
29
30/// @brief Type trait to detect if an instance of @c T is move 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_move_constructible_v = false;
34
35/// @brief Type trait to detect if an instance of @c T is move constructible without throwing
36/// @tparam T The type of the value to check
37template <typename T>
38extern constexpr bool is_nothrow_move_constructible_v<T, true> = is_nothrow_constructible_v<T, T&&>;
39
40/// @brief Type trait to detect if an instance of @c T is trivially move 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_move_constructible_v = false;
44
45/// @brief Type trait to detect if an instance of @c T is trivially move constructible
46/// @tparam T The type of the value to check
47template <typename T>
48extern constexpr bool is_trivially_move_constructible_v<T, true> = __is_trivially_constructible(T, T&&);
49} // namespace is_move_constructible_detail
50
51/// @brief Type trait to detect if an instance of @c T is move constructible
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 move constructible
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 move constructible without throwing
62/// @tparam T The type of the value to check
63template <typename T>
64extern constexpr bool is_nothrow_move_constructible_v =
66
67/// @brief Type trait to detect if an instance of @c T is move constructible without throwing
68/// @tparam T The type of the value to check
69template <typename T>
71
72/// @brief Type trait to detect if an instance of @c T is trivially move constructible
73/// @tparam T The type of the value to check
74template <typename T>
75extern constexpr bool is_trivially_move_constructible_v =
77
78/// @brief Type trait to detect if an instance of @c T is trivially move constructible
79/// @tparam T The type of the value to check
80template <typename T>
82
83} // namespace std
84
85#endif // INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_MOVE_CONSTRUCTIBLE_HPP_
Type trait to detect if an instance of T is move constructible.
Definition is_move_constructible.hpp:59
Type trait to detect if an instance of T is move constructible without throwing.
Definition is_move_constructible.hpp:70
Type trait to detect if an instance of T is trivially move constructible.
Definition is_move_constructible.hpp:81
Definition is_move_constructible.hpp:19
constexpr bool is_move_constructible_v
Type trait to detect if an instance of T is move constructible.
constexpr bool is_trivially_move_constructible_v
Type trait to detect if an instance of T is trivially move constructible.
constexpr bool is_nothrow_move_constructible_v
Type trait to detect if an instance of T is move 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