Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
internal_named_requirements.hpp
Go to the documentation of this file.
1// Copyright 2026, 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_INTERNAL_NAMED_REQUIREMENTS_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_INTERNAL_NAMED_REQUIREMENTS_HPP_
7
8#include "arene/base/constraints.hpp"
9#include "stdlib/include/stdlib_detail/declval.hpp"
10#include "stdlib/include/stdlib_detail/enable_if.hpp"
11#include "stdlib/include/stdlib_detail/is_move_assignable.hpp"
12#include "stdlib/include/stdlib_detail/is_object.hpp"
13#include "stdlib/include/stdlib_detail/is_same.hpp"
14
15// parasoft-begin-suppress CERT_CPP-DCL58-a-2 "Part of a standard library implementation"
16// parasoft-begin-suppress AUTOSAR-A17_6_1-a-2 "Part of a standard library implementation"
17
18namespace std {
19namespace internal {
21
22/// @brief determine if a type satisfies the MoveAssignable named requirement
23/// @tparam T type to check
24///
25/// Primary template.
26///
27template <class T, class = arene::base::constraints<>>
28extern constexpr bool is_move_assignable_v = false;
29
30/// @brief determine if a type satisfies the MoveAssignable named requirement
31/// @tparam T type to check
32///
33/// Specialization for types that satisfy the named requirement at a syntactic
34/// level.
35///
36template <class T>
37extern constexpr bool is_move_assignable_v<
38 T,
40 // some GCC8 bug prevents use of assignment in decltype with the other constraints
41 // NOTE: this appears to be fixed with GCC 9+
42 // see (maybe): https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63198
43 std::is_same_v<T&, decltype(std::declval<T&>() = std::declval<T&&>())>;
44
45} // namespace named_requirement
46} // namespace internal
47} // namespace std
48
49#endif // INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_INTERNAL_NAMED_REQUIREMENTS_HPP_
Definition internal_named_requirements.hpp:20
constexpr bool is_move_assignable_v
determine if a type satisfies the MoveAssignable named requirement
Definition internal_named_requirements.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