Horizon
unreachable_sentinel.hpp
Go to the documentation of this file.
1 // 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 
19 
20 #include <range/v3/detail/prologue.hpp>
21 
22 namespace ranges
23 {
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 
59 
60  namespace cpp20
61  {
62  using ranges::unreachable;
64  } // namespace cpp20
66 } // namespace ranges
67 
68 #include <range/v3/detail/epilogue.hpp>
69 
70 #endif // RANGES_V3_ITERATOR_UNREACHABLE_SENTINEL_HPP
RANGES_INLINE_VARIABLE(detail::to_container_fn< detail::from_range< std::vector >>, to_vector) template< template< typename... > class ContT > auto to(RANGES_HIDDEN_DETAIL(detail
For initializing a container of the specified type with the elements of an Range.
Definition: conversion.hpp:399
Definition: unreachable_sentinel.hpp:27