tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
is_nothrow_assignable.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2019 Tobias Hienzsch
3
4#ifndef TETL_TYPE_TRAITS_IS_NOTHROW_ASSIGNABLE_HPP
5#define TETL_TYPE_TRAITS_IS_NOTHROW_ASSIGNABLE_HPP
6
7#include <etl/_type_traits/bool_constant.hpp>
8#include <etl/_type_traits/declval.hpp>
9#include <etl/_type_traits/is_assignable.hpp>
10
11namespace etl {
12
13/// \brief If the expression etl::declval<T>() = etl::declval<U>() is
14/// well-formed in unevaluated context, provides the member constant value equal
15/// true. Otherwise, value is false. Access checks are performed as if from a
16/// context unrelated to either type.
17template <typename T, typename U>
18struct is_nothrow_assignable : false_type { };
19
20template <typename T, typename U>
21 requires is_assignable_v<T, U>
22struct is_nothrow_assignable<T, U> : bool_constant<noexcept(etl::declval<T>() = etl::declval<U>())> { };
23
24template <typename T, typename U>
26
27} // namespace etl
28
29#endif // TETL_TYPE_TRAITS_IS_NOTHROW_ASSIGNABLE_HPP
Definition adjacent_find.hpp:9
constexpr bool is_nothrow_assignable_v
Definition is_nothrow_assignable.hpp:25
If the expression etl::declval<T>() = etl::declval<U>() is well-formed in unevaluated context,...
Definition is_nothrow_assignable.hpp:18