6#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_UTILITY_SWAP_HPP_
7#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_UTILITY_SWAP_HPP_
16#include "arene/base/stdlib_choice/cstddef.hpp"
17#include "arene/base/stdlib_choice/enable_if.hpp"
18#include "arene/base/stdlib_choice/move.hpp"
25namespace swap_detail {
34auto swap() ->
void =
delete;
50 template <
typename T,
typename U, constra
ints<std::enable_if_t<is_adl_swappable_with_v<T&, U&>>> =
nullptr>
51 constexpr void operator()(T& lhs, U& rhs)
const noexcept(
noexcept(
swap(lhs, rhs))) {
81 template <
class T,
class U, std::
size_t N, constra
ints<std::enable_if_t<is_swappable_with_v<T&, U&>>> =
nullptr>
85 (*this)(lhs[idx], rhs[idx]);
131 ::arene::base::detail::cpp14_inline_static_const<swap_detail::swap_fn_impl>::value;
#define ARENE_MAYBE_UNUSED
An alias for [[maybe_unused]] , or a no-op if the attribute is not supported.
Definition maybe_unused.hpp:25
static ARENE_MAYBE_UNUSED constexpr auto const & swap
A Customization Point Object implementation of the constexpr compatible std::swap from C++17.
Definition swap.hpp:130
Definition accumulate.hpp:37
constexpr bool is_nothrow_swappable_v
Trait query indicating if a type can be noexcept-swapped.
constexpr bool is_nothrow_default_swappable_v
Trait query if a type can be noexcept swapped the default implementation.
typename constraints_impl::constraints< EnableIfs... >::type constraints
Helper used to express template constraints in a consistent way using std::enable_if_t.
Definition constraints.hpp:51
Definition accumulate.hpp:36
constexpr auto move(T &&value) noexcept -> remove_reference_t< T > &&
Cast a value to an rvalue.
Definition move.hpp:30
::size_t size_t
A type suitable for holding the size of an object.
Definition cstddef.hpp:29
typename enable_if< Condition, Type >::type enable_if_t
Type alias to support constraining templates. Is an alias for the specified type if the Condition is ...
Definition enable_if.hpp:41