tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
is_swappable.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_SWAPPABLE_HPP
5#define TETL_TYPE_TRAITS_IS_SWAPPABLE_HPP
6
7#include <etl/_type_traits/add_lvalue_reference.hpp>
8#include <etl/_type_traits/is_swappable_with.hpp>
9
10namespace etl {
11
12/// If T is not a referenceable type (i.e., possibly cv-qualified void or
13/// a function type with a cv-qualifier-seq or a ref-qualifier), provides a
14/// member constant value equal to false. Otherwise, provides a member constant
15/// value equal to etl::is_swappable_with<T&, T&>::value
16template <typename T>
17struct is_swappable : is_swappable_with<add_lvalue_reference_t<T>, add_lvalue_reference_t<T>>::type { };
18
19// clang-format on
20
21template <typename T>
22inline constexpr bool is_swappable_v = is_swappable<T>::value;
23
24} // namespace etl
25
26#endif // TETL_TYPE_TRAITS_IS_SWAPPABLE_HPP
Definition adjacent_find.hpp:9
constexpr bool is_swappable_v
Definition is_swappable.hpp:22
Definition is_swappable_with.hpp:46
If T is not a referenceable type (i.e., possibly cv-qualified void or a function type with a cv-quali...
Definition is_swappable.hpp:17