[libcxx-commits] [PATCH] D115422: [libc++][ranges] Add subsumption tests to `[special.mem.concepts]`.

Konstantin Varlamov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Dec 8 20:31:17 PST 2021


var-const updated this revision to Diff 393021.
var-const added a comment.

Update commit description.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115422/new/

https://reviews.llvm.org/D115422

Files:
  libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_forward_iterator.compile.pass.cpp
  libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_forward_range.compile.pass.cpp


Index: libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_forward_range.compile.pass.cpp
===================================================================
--- libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_forward_range.compile.pass.cpp
+++ libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_forward_range.compile.pass.cpp
@@ -12,6 +12,7 @@
 // template<class R>
 // concept __nothrow_forward_range;
 
+#include <array>
 #include <memory>
 
 #include "test_iterators.h"
@@ -33,3 +34,12 @@
 static_assert(!std::ranges::__nothrow_forward_range<test_range<cpp20_input_iterator>>);
 static_assert(std::ranges::forward_range<test_range<ForwardProxyIterator>>);
 static_assert(!std::ranges::__nothrow_forward_range<test_range<ForwardProxyIterator>>);
+
+constexpr bool forward_subsumes_input(std::ranges::__nothrow_forward_range auto)
+  requires true {
+  return true;
+}
+constexpr bool forward_subsumes_input(std::ranges::__nothrow_input_range auto);
+
+constexpr std::array<int, 3> array{};
+static_assert(forward_subsumes_input(array));
Index: libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_forward_iterator.compile.pass.cpp
===================================================================
--- libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_forward_iterator.compile.pass.cpp
+++ libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_forward_iterator.compile.pass.cpp
@@ -31,16 +31,9 @@
 static_assert(!std::ranges::__nothrow_forward_iterator<ForwardProxyIterator>);
 
 constexpr bool forward_subsumes_input(std::ranges::__nothrow_forward_iterator auto)
-    requires true {
+  requires true {
   return true;
 }
 constexpr bool forward_subsumes_input(std::ranges::__nothrow_input_iterator auto);
 
-constexpr bool input_subsumes_forward(std::ranges::__nothrow_input_iterator auto)
-    requires true {
-  return true;
-}
-constexpr bool input_subsumes_forward(std::ranges::__nothrow_forward_iterator auto);
-
 static_assert(forward_subsumes_input("foo"));
-static_assert(!input_subsumes_forward("foo"));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115422.393021.patch
Type: text/x-patch
Size: 2203 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211209/c0b6c92f/attachment.bin>


More information about the libcxx-commits mailing list