Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
iter_swap.hpp
Go to the documentation of this file.
1
// Copyright 2026, Toyota Motor Corporation
2
//
3
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5
#
ifndef
INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_ITER_SWAP_HPP_
6
#
define
INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_ITER_SWAP_HPP_
7
8
// parasoft-begin-suppress CERT_CPP-DCL58-a-2 "Part of a standard library implementation"
9
// parasoft-begin-suppress AUTOSAR-A17_6_1-a-2 "Part of a standard library implementation"
10
11
// IWYU pragma: private, include <utility>
12
// IWYU pragma: friend "stdlib_detail/.*"
13
14
#
include
"arene/base/constraints.hpp"
15
#
include
"arene/base/type_traits/is_swappable.hpp"
16
#
include
"arene/base/type_traits/iterator_category_traits.hpp"
17
#
include
"stdlib/include/stdlib_detail/enable_if.hpp"
18
#
include
"stdlib/include/stdlib_detail/swap.hpp"
19
20
namespace
std
{
21
22
/// @brief swaps the objects pointed to by two iterators
23
///
24
/// @tparam ForwardIterator1 type of the first iterator
25
/// @tparam ForwardIterator2 type of the second iterator
26
/// @param lhs first iterator to object to swap
27
/// @param rhs second iterator to object to swap
28
template
<
29
class
ForwardIterator1
,
30
class
ForwardIterator2
,
31
arene
::
base
::
constraints
<
32
std
::
enable_if_t
<
arene
::
base
::
is_forward_iterator_v
<
ForwardIterator1
>>,
33
std
::
enable_if_t
<
arene
::
base
::
is_forward_iterator_v
<
ForwardIterator2
>>,
34
std
::
enable_if_t
<
arene
::
base
::
is_swappable_with_v
<
35
typename
std
::
iterator_traits
<
ForwardIterator1
>::
reference
,
36
typename
std
::
iterator_traits
<
ForwardIterator2
>::
reference
>>> =
nullptr
>
37
constexpr
auto
iter_swap
(
38
ForwardIterator1
lhs
,
39
ForwardIterator2
rhs
40
)
noexcept
(
arene
::
base
::
41
is_nothrow_swappable_with_v
<
42
typename
std
::
iterator_traits
<
ForwardIterator1
>::
reference
,
43
typename
std
::
iterator_traits
<
ForwardIterator2
>::
reference
>) ->
void
{
44
using
std
::
swap
;
45
swap
(*
lhs
, *
rhs
);
46
}
47
48
}
// namespace std
49
50
#
endif
// INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_ITER_SWAP_HPP_
std::hash<::arene::base::result< void, E > >::operator()
constexpr auto operator()(::arene::base::result< void, E > const &value) const noexcept(noexcept(hash< E >{}(std::declval< E const & >()))) -> std::size_t
Calculate the hash of a result.
Definition
result.hpp:1827
stdlib
include
stdlib_detail
iter_swap.hpp
Generated by
1.13.2