5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_SWAP_ELEMENTS_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_SWAP_ELEMENTS_HPP_
12#include "arene/base/detail/index_permutation_range.hpp"
13#include "arene/base/linalg/detail/mandates.hpp"
14#include "arene/base/mdspan/detail/to_array.hpp"
15#include "arene/base/stdlib_choice/enable_if.hpp"
27namespace swap_elements_detail {
30class swap_elements_fn {
44 linalg_detail::possibly_comparable_constraints<LeftSpan, RightSpan>,
48 constexpr auto operator()(LeftSpan
const left, RightSpan
const right)
const noexcept(
58 auto const extents_array = mdspan_detail::to_array(left.extents());
60 for (
auto const& indices : arene::base::detail::make_index_permutation_range(extents_array)) {
#define ARENE_CPP14_INLINE_VARIABLE(type, name)
Emulates C++17's inline variable declarations for function objects.
Definition cpp14_inline.hpp:69
#define ARENE_PRECONDITION(condition)
Check that a precondition holds, and terminate the application if it does not.
Definition contract.hpp:150
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_with_v
Trait query indicating if two types can be noexcept-swapped.
constexpr bool is_nothrow_invocable_v
Determine if a functor type is no-throw invocable with the specified argument types.
constexpr bool is_swappable_with_v
Trait query indicating two types can be swapped.
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
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