[libcxx-commits] [libcxx] [libc++] Vectorize std::mismatch with trivially equality comparable types (PR #87716)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Apr 12 08:46:55 PDT 2024
================
@@ -0,0 +1,120 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ITERATOR_ALIASING_ITERATOR_H
+#define _LIBCPP___ITERATOR_ALIASING_ITERATOR_H
+
+#include <__compare/strong_order.h>
+#include <__config>
+#include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_trivial.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _BaseT, class _Alias>
+struct __aliasing_iterator_wrapper {
+ class __iterator {
+ _BaseT* __base_ = nullptr;
----------------
ldionne wrote:
I would like to add some libc++ specific tests for this class. It's a tricky one, so I think it's worth it. In particular, we should check that it works with non-trivial source types.
The intent would be that these tests fail very obviously in UBSan mode if we're doing something wrong that we missed during this review.
https://github.com/llvm/llvm-project/pull/87716
More information about the libcxx-commits
mailing list