Horizon
infinity.hpp
1 // Range v3 library
2 //
3 // Copyright Eric Niebler 2014-present
4 //
5 // Use, modification and distribution is subject to the
6 // Boost Software License, Version 1.0. (See accompanying
7 // file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
9 //
10 // Project home: https://github.com/ericniebler/range-v3
11 //
12 
13 #ifndef RANGES_V3_UTILITY_INFINITY_HPP
14 #define RANGES_V3_UTILITY_INFINITY_HPP
15 
16 #include <concepts/concepts.hpp>
17 
18 #include <range/v3/range_fwd.hpp>
20  "This header is deprecated and will be removed from a future version of range-v3.")
21 
22 #include <range/v3/detail/prologue.hpp>
23 
24 namespace ranges
25 {
27  struct infinity
28  {
29  friend constexpr bool operator==(infinity, infinity)
30  {
31  return true;
32  }
33  friend constexpr bool operator!=(infinity, infinity)
34  {
35  return false;
36  }
37  template<typename Integer>
38  friend constexpr auto operator==(Integer, infinity) noexcept
39  -> CPP_broken_friend_ret(bool)(
40  requires integral<Integer>)
41  {
42  return false;
43  }
44  template<typename Integer>
45  friend constexpr auto operator==(infinity, Integer) noexcept
46  -> CPP_broken_friend_ret(bool)(
47  requires integral<Integer>)
48  {
49  return false;
50  }
51  template<typename Integer>
52  friend constexpr auto operator!=(Integer, infinity) noexcept
53  -> CPP_broken_friend_ret(bool)(
54  requires integral<Integer>)
55  {
56  return true;
57  }
58  template<typename Integer>
59  friend constexpr auto operator!=(infinity, Integer) noexcept
60  -> CPP_broken_friend_ret(bool)(
61  requires integral<Integer>)
62  {
63  return true;
64  }
65  };
67 } // namespace ranges
68 
69 #include <range/v3/detail/epilogue.hpp>
70 
71 #endif
RANGES_DEPRECATED_HEADER("This header is deprecated and will be removed from a future version of range-v3.") namespace ranges
Definition: nullptr_v.hpp:17