Based on D100160.
Reviewed By: cjdb, ldionne, Quuxplusone, #libc, miscco
Differential Revision: https://reviews.llvm.org/D100587
input_or_output_iterator<_Ip> &&
__weakly_equality_comparable_with<_Sp, _Ip>;
+template<class, class>
+inline constexpr bool disable_sized_sentinel_for = false;
+
+template<class _Sp, class _Ip>
+concept sized_sentinel_for =
+ sentinel_for<_Sp, _Ip> &&
+ !disable_sized_sentinel_for<remove_cv_t<_Sp>, remove_cv_t<_Ip> > &&
+ requires(const _Ip& __i, const _Sp& __s) {
+ { __s - __i } -> same_as<iter_difference_t<_Ip> >;
+ { __i - __s } -> same_as<iter_difference_t<_Ip> >;
+ };
+
// clang-format on
#endif // !defined(_LIBCPP_HAS_NO_RANGES)
template<class S, class I>
concept sentinel_for = see below; // since C++20
+// [iterator.concept.sizedsentinel], concept sized_sentinel_for
+template<class S, class I>
+ inline constexpr bool disable_sized_sentinel_for = false;
+
+template<class S, class I>
+ concept sized_sentinel_for = see below;
+
template<class Category, class T, class Distance = ptrdiff_t,
class Pointer = T*, class Reference = T&>
struct iterator
#include <__iterator/iter_move.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/readable_traits.h>
+#include <__iterator/concepts.h>
#include <__memory/addressof.h>
#include <__memory/pointer_traits.h>
#include <version>
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, reverse_iterator>);
static_assert(!std::sentinel_for<iterator, const_reverse_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
static_assert(std::indirectly_readable<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
static_assert(!std::sentinel_for<const_iterator, const_reverse_iterator>);
+static_assert(std::sentinel_for<iterator, iterator>);
+static_assert(std::sentinel_for<iterator, const_iterator>);
+static_assert(!std::sentinel_for<iterator, reverse_iterator>);
+static_assert(!std::sentinel_for<iterator, const_reverse_iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, reverse_iterator>);
static_assert(!std::sentinel_for<iterator, const_reverse_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
static_assert(std::indirectly_readable<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
static_assert(!std::sentinel_for<const_iterator, const_reverse_iterator>);
+static_assert(std::sentinel_for<iterator, iterator>);
+static_assert(std::sentinel_for<iterator, const_iterator>);
+static_assert(!std::sentinel_for<iterator, reverse_iterator>);
+static_assert(!std::sentinel_for<iterator, const_reverse_iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, reverse_iterator>);
static_assert(!std::sentinel_for<iterator, const_reverse_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
static_assert(std::indirectly_readable<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
static_assert(std::sentinel_for<const_iterator, iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
static_assert(!std::sentinel_for<const_iterator, const_reverse_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, reverse_iterator>);
static_assert(!std::sentinel_for<iterator, const_reverse_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
static_assert(std::indirectly_readable<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
static_assert(!std::sentinel_for<const_iterator, const_reverse_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
static_assert(!std::sentinel_for<const_iterator, const_reverse_iterator>);
+
+static_assert(std::sized_sentinel_for<iterator, iterator>);
+static_assert(std::sized_sentinel_for<iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
+
+static_assert(std::sized_sentinel_for<const_iterator, iterator>);
+static_assert(std::sized_sentinel_for<const_iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, reverse_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, const_reverse_iterator>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
static_assert(!std::sentinel_for<const_iterator, const_reverse_iterator>);
+
+static_assert(std::sized_sentinel_for<iterator, iterator>);
+static_assert(std::sized_sentinel_for<iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
+
+static_assert(std::sized_sentinel_for<const_iterator, iterator>);
+static_assert(std::sized_sentinel_for<const_iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, reverse_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, const_reverse_iterator>);
static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
static_assert(std::indirectly_readable<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
static_assert(std::input_or_output_iterator<const_iterator>);
static_assert(std::sentinel_for<const_iterator, iterator>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, const_iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, reverse_iterator>);
static_assert(!std::sentinel_for<iterator, const_reverse_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
static_assert(std::indirectly_readable<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
static_assert(!std::sentinel_for<const_iterator, const_reverse_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, reverse_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, const_reverse_iterator>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
static_assert(!std::sentinel_for<const_iterator, const_reverse_iterator>);
+
+static_assert(std::sized_sentinel_for<iterator, iterator>);
+static_assert(std::sized_sentinel_for<iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
+
+static_assert(std::sized_sentinel_for<const_iterator, iterator>);
+static_assert(std::sized_sentinel_for<const_iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, reverse_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, const_reverse_iterator>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
static_assert(!std::sentinel_for<const_iterator, const_reverse_iterator>);
+
+static_assert(std::sized_sentinel_for<iterator, iterator>);
+static_assert(std::sized_sentinel_for<iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
+
+static_assert(std::sized_sentinel_for<const_iterator, iterator>);
+static_assert(std::sized_sentinel_for<const_iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, reverse_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, const_reverse_iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, local_iterator>);
static_assert(!std::sentinel_for<iterator, const_local_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, local_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_local_iterator>);
static_assert(std::indirectly_readable<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
static_assert(std::incrementable<const_iterator>);
+static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<const_iterator, iterator>);
+static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, local_iterator>);
static_assert(!std::sentinel_for<const_iterator, const_local_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, local_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, const_local_iterator>);
static_assert(std::indirectly_readable<local_iterator>);
+static_assert(!std::indirectly_writable<local_iterator, value_type>);
static_assert(std::incrementable<local_iterator>);
static_assert(std::input_or_output_iterator<iterator>);
static_assert(!std::sentinel_for<local_iterator, iterator>);
static_assert(!std::sentinel_for<local_iterator, const_iterator>);
static_assert(std::sentinel_for<local_iterator, local_iterator>);
static_assert(std::sentinel_for<local_iterator, const_local_iterator>);
+static_assert(!std::sized_sentinel_for<local_iterator, iterator>);
+static_assert(!std::sized_sentinel_for<local_iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<local_iterator, local_iterator>);
+static_assert(!std::sized_sentinel_for<local_iterator, const_local_iterator>);
static_assert(std::indirectly_readable<const_local_iterator>);
static_assert(!std::indirectly_writable<const_local_iterator, value_type>);
static_assert(!std::sentinel_for<const_local_iterator, const_iterator>);
static_assert(std::sentinel_for<const_local_iterator, local_iterator>);
static_assert(std::sentinel_for<const_local_iterator, const_local_iterator>);
+static_assert(!std::sized_sentinel_for<const_local_iterator, iterator>);
+static_assert(!std::sized_sentinel_for<const_local_iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<const_local_iterator, local_iterator>);
+static_assert(!std::sized_sentinel_for<const_local_iterator, const_local_iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, local_iterator>);
static_assert(!std::sentinel_for<iterator, const_local_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, local_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_local_iterator>);
static_assert(std::indirectly_readable<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, local_iterator>);
static_assert(!std::sentinel_for<const_iterator, const_local_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, local_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, const_local_iterator>);
static_assert(std::indirectly_readable<local_iterator>);
static_assert(!std::indirectly_writable<local_iterator, value_type>);
static_assert(!std::sentinel_for<local_iterator, const_iterator>);
static_assert(std::sentinel_for<local_iterator, local_iterator>);
static_assert(std::sentinel_for<local_iterator, const_local_iterator>);
+static_assert(!std::sized_sentinel_for<local_iterator, iterator>);
+static_assert(!std::sized_sentinel_for<local_iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<local_iterator, local_iterator>);
+static_assert(!std::sized_sentinel_for<local_iterator, const_local_iterator>);
static_assert(std::indirectly_readable<const_local_iterator>);
static_assert(!std::indirectly_writable<const_local_iterator, value_type>);
static_assert(!std::sentinel_for<const_local_iterator, const_iterator>);
static_assert(std::sentinel_for<const_local_iterator, local_iterator>);
static_assert(std::sentinel_for<const_local_iterator, const_local_iterator>);
+static_assert(!std::sized_sentinel_for<const_local_iterator, iterator>);
+static_assert(!std::sized_sentinel_for<const_local_iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<const_local_iterator, local_iterator>);
+static_assert(!std::sized_sentinel_for<const_local_iterator, const_local_iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, local_iterator>);
static_assert(!std::sentinel_for<iterator, const_local_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, local_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_local_iterator>);
static_assert(std::indirectly_readable<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, local_iterator>);
static_assert(!std::sentinel_for<const_iterator, const_local_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, local_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, const_local_iterator>);
static_assert(std::indirectly_readable<local_iterator>);
static_assert(!std::indirectly_writable<local_iterator, value_type>);
static_assert(!std::sentinel_for<local_iterator, const_iterator>);
static_assert(std::sentinel_for<local_iterator, local_iterator>);
static_assert(std::sentinel_for<local_iterator, const_local_iterator>);
+static_assert(!std::sized_sentinel_for<local_iterator, iterator>);
+static_assert(!std::sized_sentinel_for<local_iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<local_iterator, local_iterator>);
+static_assert(!std::sized_sentinel_for<local_iterator, const_local_iterator>);
static_assert(std::indirectly_readable<const_local_iterator>);
static_assert(!std::indirectly_writable<const_local_iterator, value_type>);
static_assert(!std::sentinel_for<const_local_iterator, const_iterator>);
static_assert(std::sentinel_for<const_local_iterator, local_iterator>);
static_assert(std::sentinel_for<const_local_iterator, const_local_iterator>);
+static_assert(!std::sized_sentinel_for<const_local_iterator, iterator>);
+static_assert(!std::sized_sentinel_for<const_local_iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<const_local_iterator, local_iterator>);
+static_assert(!std::sized_sentinel_for<const_local_iterator, const_local_iterator>);
static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
static_assert(!std::sentinel_for<iterator, reverse_iterator>);
+static_assert(std::sized_sentinel_for<iterator, iterator>);
+static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
static_assert(!std::incrementable<fs::directory_iterator>);
static_assert(std::input_or_output_iterator<fs::directory_iterator>);
static_assert(std::sentinel_for<fs::directory_iterator, fs::directory_iterator>);
+static_assert(!std::sized_sentinel_for<fs::directory_iterator, fs::directory_iterator>);
static_assert(std::indirectly_readable<fs::recursive_directory_iterator>);
static_assert(
static_assert(!std::incrementable<fs::recursive_directory_iterator>);
static_assert(std::input_or_output_iterator<fs::recursive_directory_iterator>);
static_assert(std::sentinel_for<fs::recursive_directory_iterator, fs::recursive_directory_iterator>);
+static_assert(!std::sized_sentinel_for<fs::recursive_directory_iterator, fs::recursive_directory_iterator>);
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-no-concepts
+// UNSUPPORTED: gcc-10
+// XFAIL: msvc && clang
+
+// [iterator.concept.sizedsentinel], concept sized_sentinel_for
+//
+// template<class S, class I>
+// inline constexpr bool disable_sized_sentinel_for = false;
+//
+// template<class S, class I>
+// concept sized_sentinel_for = see below;
+
+#include <iterator>
+
+#include <array>
+#include <concepts>
+#include <deque>
+#include <string>
+#include <string_view>
+#include <vector>
+
+#include "test_iterators.h"
+#include "test_macros.h"
+
+static_assert(std::sized_sentinel_for<random_access_iterator<int*>, random_access_iterator<int*> >);
+static_assert(!std::sized_sentinel_for<bidirectional_iterator<int*>, bidirectional_iterator<int*> >);
+
+struct int_sized_sentinel {
+ friend bool operator==(int_sized_sentinel, int*);
+ friend std::ptrdiff_t operator-(int_sized_sentinel, int*);
+ friend std::ptrdiff_t operator-(int*, int_sized_sentinel);
+};
+static_assert(std::sized_sentinel_for<int_sized_sentinel, int*>);
+// int_sized_sentinel is not an iterator.
+static_assert(!std::sized_sentinel_for<int*, int_sized_sentinel>);
+
+struct no_default_ctor {
+ no_default_ctor() = delete;
+ bool operator==(std::input_or_output_iterator auto) const;
+};
+static_assert(!std::sized_sentinel_for<no_default_ctor, int*>);
+
+struct not_copyable {
+ not_copyable() = default;
+ not_copyable(not_copyable const&) = delete;
+ bool operator==(std::input_or_output_iterator auto) const;
+};
+static_assert(!std::sized_sentinel_for<not_copyable, int*>);
+
+struct double_sized_sentinel {
+ friend bool operator==(double_sized_sentinel, double*);
+ friend int operator-(double_sized_sentinel, double*);
+ friend int operator-(double*, double_sized_sentinel);
+};
+template <>
+inline constexpr bool std::disable_sized_sentinel_for<double_sized_sentinel, double*> = true;
+
+static_assert(!std::sized_sentinel_for<double_sized_sentinel, double*>);
+
+struct only_one_sub_op {
+ friend bool operator==(only_one_sub_op, std::input_or_output_iterator auto);
+ friend std::ptrdiff_t operator-(only_one_sub_op, std::input_or_output_iterator auto);
+};
+static_assert(!std::sized_sentinel_for<only_one_sub_op, int*>);
+
+struct wrong_return_type {
+ friend bool operator==(wrong_return_type, std::input_or_output_iterator auto);
+ friend std::ptrdiff_t operator-(wrong_return_type, std::input_or_output_iterator auto);
+ friend void operator-(std::input_or_output_iterator auto, wrong_return_type);
+};
+static_assert(!std::sized_sentinel_for<wrong_return_type, int*>);
+
+// Standard types
+static_assert(std::sized_sentinel_for<int*, int*>);
+static_assert(std::sized_sentinel_for<const int*, int*>);
+static_assert(std::sized_sentinel_for<const int*, const int*>);
+static_assert(std::sized_sentinel_for<int*, const int*>);
static_assert(!std::weakly_incrementable<iterator>);
static_assert(!std::input_or_output_iterator<iterator>);
static_assert(!std::sentinel_for<iterator, iterator>);
+static_assert(!std::sized_sentinel_for<iterator, iterator>);
static_assert(!std::weakly_incrementable<iterator>);
static_assert(!std::input_or_output_iterator<iterator>);
static_assert(!std::sentinel_for<iterator, iterator>);
+static_assert(!std::sized_sentinel_for<iterator, iterator>);
static_assert(std::incrementable<iterator>);
static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
+static_assert(std::sized_sentinel_for<iterator, iterator>);
static_assert(std::incrementable<iterator>);
static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
+static_assert(std::sized_sentinel_for<iterator, iterator>);
using other_iterator = std::reverse_iterator<float*>;
static_assert(std::sentinel_for<iterator, other_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, other_iterator>);
static_assert(std::incrementable<iterator>);
static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
+static_assert(!std::sized_sentinel_for<iterator, iterator>);
static_assert(!std::incrementable<iterator>);
static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
+static_assert(!std::sized_sentinel_for<iterator, iterator>);
static_assert(!std::weakly_incrementable<iterator>);
static_assert(!std::input_or_output_iterator<iterator>);
static_assert(!std::sentinel_for<iterator, iterator>);
+static_assert(!std::sized_sentinel_for<iterator, iterator>);
static_assert(!std::weakly_incrementable<iterator>);
static_assert(!std::input_or_output_iterator<iterator>);
static_assert(!std::sentinel_for<iterator, iterator>);
+static_assert(!std::sized_sentinel_for<iterator, iterator>);
static_assert(std::incrementable<std::cregex_iterator>);
static_assert(std::input_or_output_iterator<std::cregex_iterator>);
static_assert(std::sentinel_for<std::cregex_iterator, std::cregex_iterator>);
+static_assert(!std::sized_sentinel_for<std::cregex_iterator, std::cregex_iterator>);
static_assert(std::incrementable<std::cregex_token_iterator>);
static_assert(std::input_or_output_iterator<std::cregex_token_iterator>);
static_assert(std::sentinel_for<std::cregex_token_iterator, std::cregex_token_iterator>);
+static_assert(!std::sized_sentinel_for<std::cregex_token_iterator, std::cregex_token_iterator>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
static_assert(!std::sentinel_for<const_iterator, const_reverse_iterator>);
+
+static_assert(std::sized_sentinel_for<iterator, iterator>);
+static_assert(std::sized_sentinel_for<iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
+
+static_assert(std::sized_sentinel_for<const_iterator, iterator>);
+static_assert(std::sized_sentinel_for<const_iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, reverse_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, const_reverse_iterator>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
static_assert(!std::sentinel_for<const_iterator, const_reverse_iterator>);
+
+static_assert(std::sized_sentinel_for<iterator, iterator>);
+static_assert(std::sized_sentinel_for<iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
+
+static_assert(std::sized_sentinel_for<const_iterator, iterator>);
+static_assert(std::sized_sentinel_for<const_iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, reverse_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, const_reverse_iterator>);