tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
is_nothrow_swappable_with.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_WITH_HPP
4#define TETL_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_WITH_HPP
5
11
12namespace etl {
13
14// clang-format off
15template <typename T, typename U>
16struct _swap_no_throw : bool_constant<noexcept(swap(declval<T>(), declval<U>())) && noexcept(swap(declval<U>(), declval<T>()))> { }; // NOLINT
17// clang-format on
18
20template <typename T, typename U>
21struct is_nothrow_swappable_with : bool_constant<conjunction_v<is_swappable_with<T, U>, _swap_no_throw<T, U>>> { };
22
25template <typename T, typename U>
27
28} // namespace etl
29
30#endif // TETL_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_WITH_HPP
constexpr bool is_nothrow_swappable_with_v
Definition is_nothrow_swappable_with.hpp:26
Definition adjacent_find.hpp:8
integral_constant< bool, B > bool_constant
Definition bool_constant.hpp:11
Definition is_nothrow_swappable_with.hpp:16
static constexpr bool value
Definition integral_constant.hpp:10
Definition is_nothrow_swappable_with.hpp:21