Debian Codegraph @

3rd_party/range-v3/range/v3/iterator/unreachable_sentinel.hpp

raw
1 /// \file
2 // Range v3 library
3 //
4 // Copyright Eric Niebler 2014-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 #ifndef RANGES_V3_ITERATOR_UNREACHABLE_SENTINEL_HPP
14 #define RANGES_V3_ITERATOR_UNREACHABLE_SENTINEL_HPP
15
16 #include <range/v3/range_fwd.hpp>
17
18 #include <range/v3/iterator/concepts.hpp>
19
20 #include <range/v3/detail/prologue.hpp>
21
22 namespace ranges
23 {
24 /// \addtogroup group-iterator
25 /// @{
26 struct unreachable_sentinel_t
27 {
28 template<typename I>
29 friend constexpr auto operator==(I const &, unreachable_sentinel_t) noexcept
30 -> CPP_broken_friend_ret(bool)(
31 requires weakly_incrementable<I>)
32 {
33 return false;
34 }
35 template<typename I>
36 friend constexpr auto operator==(unreachable_sentinel_t, I const &) noexcept
37 -> CPP_broken_friend_ret(bool)(
38 requires weakly_incrementable<I>)
39 {
40 return false;
41 }
42 template<typename I>
43 friend constexpr auto operator!=(I const &, unreachable_sentinel_t) noexcept
44 -> CPP_broken_friend_ret(bool)(
45 requires weakly_incrementable<I>)
46 {
47 return true;
48 }
49 template<typename I>
50 friend constexpr auto operator!=(unreachable_sentinel_t, I const &) noexcept
51 -> CPP_broken_friend_ret(bool)(
52 requires weakly_incrementable<I>)
53 {
54 return true;
55 }
56 };
57
58 RANGES_INLINE_VARIABLE(unreachable_sentinel_t, unreachable)
59
60 namespace cpp20
61 {
62 using ranges::unreachable;
63 using ranges::unreachable_sentinel_t;
64 } // namespace cpp20
65 /// @}
66 } // namespace ranges
67
68 #include <range/v3/detail/epilogue.hpp>
69
70 #endif // RANGES_V3_ITERATOR_UNREACHABLE_SENTINEL_HPP