Changeset View
Changeset View
Standalone View
Standalone View
libcxx/include/__ranges/iota_view.h
// -*- C++ -*- | // -*- C++ -*- | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// | // | ||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||||
// See https://llvm.org/LICENSE.txt for license information. | // See https://llvm.org/LICENSE.txt for license information. | ||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
#ifndef _LIBCPP___RANGES_IOTA_VIEW_H | #ifndef _LIBCPP___RANGES_IOTA_VIEW_H | ||||
#define _LIBCPP___RANGES_IOTA_VIEW_H | #define _LIBCPP___RANGES_IOTA_VIEW_H | ||||
#include <__compare/three_way_comparable.h> | |||||
#include <__concepts/arithmetic.h> | |||||
#include <__concepts/constructible.h> | |||||
#include <__concepts/convertible_to.h> | |||||
#include <__concepts/copyable.h> | |||||
#include <__concepts/equality_comparable.h> | |||||
#include <__concepts/invocable.h> | |||||
#include <__concepts/same_as.h> | |||||
#include <__concepts/semiregular.h> | |||||
#include <__concepts/totally_ordered.h> | |||||
#include <__config> | #include <__config> | ||||
#include <__debug> | #include <__debug> | ||||
#include <__functional/ranges_operations.h> | #include <__functional/ranges_operations.h> | ||||
#include <__iterator/concepts.h> | #include <__iterator/concepts.h> | ||||
#include <__iterator/incrementable_traits.h> | #include <__iterator/incrementable_traits.h> | ||||
#include <__iterator/iterator_traits.h> | #include <__iterator/iterator_traits.h> | ||||
#include <__iterator/unreachable_sentinel.h> | #include <__iterator/unreachable_sentinel.h> | ||||
#include <__ranges/copyable_box.h> | #include <__ranges/copyable_box.h> | ||||
#include <__ranges/enable_borrowed_range.h> | #include <__ranges/enable_borrowed_range.h> | ||||
#include <__ranges/view_interface.h> | #include <__ranges/view_interface.h> | ||||
#include <__utility/forward.h> | #include <__utility/forward.h> | ||||
#include <__utility/move.h> | #include <__utility/move.h> | ||||
#include <concepts> | |||||
#include <type_traits> | #include <type_traits> | ||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) | ||||
#pragma GCC system_header | #pragma GCC system_header | ||||
#endif | #endif | ||||
_LIBCPP_BEGIN_NAMESPACE_STD | _LIBCPP_BEGIN_NAMESPACE_STD | ||||
▲ Show 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | struct __iterator : public __iota_iterator_category<_Start> { | ||||
_LIBCPP_HIDE_FROM_ABI | _LIBCPP_HIDE_FROM_ABI | ||||
friend constexpr bool operator>=(const __iterator& __x, const __iterator& __y) | friend constexpr bool operator>=(const __iterator& __x, const __iterator& __y) | ||||
requires totally_ordered<_Start> | requires totally_ordered<_Start> | ||||
{ | { | ||||
return !(__x < __y); | return !(__x < __y); | ||||
} | } | ||||
// friend constexpr auto operator<=>(const __iterator& __x, const __iterator& __y) | friend constexpr auto operator<=>(const __iterator& __x, const __iterator& __y) | ||||
// requires totally_ordered<_Start> && three_way_comparable<_Start> | requires totally_ordered<_Start> && three_way_comparable<_Start> | ||||
// { | { | ||||
// return __x.__value_ <=> __y.__value_; | return __x.__value_ <=> __y.__value_; | ||||
// } | } | ||||
_LIBCPP_HIDE_FROM_ABI | _LIBCPP_HIDE_FROM_ABI | ||||
friend constexpr __iterator operator+(__iterator __i, difference_type __n) | friend constexpr __iterator operator+(__iterator __i, difference_type __n) | ||||
requires __advanceable<_Start> | requires __advanceable<_Start> | ||||
{ | { | ||||
__i += __n; | __i += __n; | ||||
return __i; | return __i; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 172 Lines • Show Last 20 Lines |