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// SPDX-FileCopyrightText: Copyright (C) 2019 Tobias Hienzsch
3
4#ifndef TETL_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_WITH_HPP
5#define TETL_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_WITH_HPP
6
7#include <etl/_type_traits/add_lvalue_reference.hpp>
8#include <etl/_type_traits/bool_constant.hpp>
9#include <etl/_type_traits/conjunction.hpp>
10#include <etl/_type_traits/declval.hpp>
11#include <etl/_type_traits/is_swappable_with.hpp>
12
13namespace etl {
14
15// clang-format off
16template <typename T, typename U>
17struct _swap_no_throw : bool_constant<noexcept(swap(declval<T>(), declval<U>())) && noexcept(swap(declval<U>(), declval<T>()))> { }; // NOLINT
18// clang-format on
19
20/// \ingroup type_traits
21template <typename T, typename U>
22struct is_nothrow_swappable_with : bool_constant<conjunction_v<is_swappable_with<T, U>, _swap_no_throw<T, U>>> { };
23
24/// \ingroup type_traits
25/// \relates is_nothrow_swappable_with
26template <typename T, typename U>
28
29} // namespace etl
30
31#endif // TETL_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_WITH_HPP
constexpr bool is_nothrow_swappable_with_v
Definition is_nothrow_swappable_with.hpp:27
Definition adjacent_find.hpp:9
Definition is_nothrow_swappable_with.hpp:17
Definition is_nothrow_swappable_with.hpp:22
Definition is_swappable_with.hpp:46