[libcxx-commits] [libcxx] [libc++][PSTL] Implement std::equal (PR #72448)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Nov 17 07:58:24 PST 2023
================
@@ -0,0 +1,98 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+
+// UNSUPPORETD: libcpp-has-no-incomplete-pstl
+
+// <algorithm>
+
+// template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
+// bool equal(ExecutionPolicy&& exec,
+// ForwardIterator1 first1, ForwardIterator1 last1,
+// ForwardIterator2 first2);
+//
+// template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
+// class BinaryPredicate>
+// bool equal(ExecutionPolicy&& exec,
+// ForwardIterator1 first1, ForwardIterator1 last1,
+// ForwardIterator2 first2, BinaryPredicate pred);
+//
+// template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
+// bool equal(ExecutionPolicy&& exec,
+// ForwardIterator1 first1, ForwardIterator1 last1,
+// ForwardIterator2 first2, ForwardIterator2 last2);
+//
+// template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
+// class BinaryPredicate>
+// bool equal(ExecutionPolicy&& exec,
+// ForwardIterator1 first1, ForwardIterator1 last1,
+// ForwardIterator2 first2, ForwardIterator2 last2,
+// BinaryPredicate pred);
+
+#include <algorithm>
+#include <cassert>
+
+#include "test_execution_policies.h"
+#include "test_iterators.h"
+#include "test_macros.h"
+
+template <class Iter1, class Iter2>
+struct Test {
+ template <class Policy>
+ void operator()(Policy&& policy) {
+ { // 3 iter overloads
----------------
ldionne wrote:
We need to test combinations of empty ranges (empty/non-empty, non-empty/empty, empty/empty)
https://github.com/llvm/llvm-project/pull/72448
More information about the libcxx-commits
mailing list