Debian Codegraph @

3rd_party/range-v3/range/v3/utility/swap.hpp

raw
1 /// \file
2 // Range v3 library
3 //
4 // Copyright Eric Niebler 2013-present
5 //
6 // Use, modification and distribution is subject to the
7 // Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
10 //
11 // Project home: https://github.com/ericniebler/range-v3
12 //
13 // The implementation of swap (see below) has been adapted from libc++
14 // (http://libcxx.llvm.org).
15
16 #ifndef RANGES_V3_UTILITY_SWAP_HPP
17 #define RANGES_V3_UTILITY_SWAP_HPP
18
19 #include <concepts/swap.hpp>
20
21 #include <range/v3/range_fwd.hpp>
22
23 #include <range/v3/utility/static_const.hpp>
24
25 #include <range/v3/detail/prologue.hpp>
26
27 namespace ranges
28 {
29 template<typename T>
30 using is_swappable = concepts::is_swappable<T>;
31
32 template<typename T>
33 using is_nothrow_swappable = concepts::is_nothrow_swappable<T>;
34
35 template<typename T, typename U>
36 using is_swappable_with = concepts::is_swappable_with<T, U>;
37
38 template<typename T, typename U>
39 using is_nothrow_swappable_with = concepts::is_nothrow_swappable_with<T, U>;
40
41 using concepts::exchange;
42
43 /// \ingroup group-utility
44 /// \relates concepts::adl_swap_detail::swap_fn
45 RANGES_DEFINE_CPO(uncvref_t<decltype(concepts::swap)>, swap)
46
47 namespace cpp20
48 {
49 using ranges::swap;
50 }
51 } // namespace ranges
52
53 #include <range/v3/detail/epilogue.hpp>
54
55 #endif