[libcxx-commits] [libcxx] [libc++] <experimental/simd> Add operator value_type() of simd reference (PR #68960)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 13 02:38:50 PDT 2023


================
@@ -0,0 +1,49 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+
+// <experimental/simd>
+//
+// [simd.reference]
+// operator value_type() const noexcept;
+
+#include "../test_utils.h"
+#include <experimental/simd>
+
+namespace ex = std::experimental::parallelism_v2;
+
+template <class T, std::size_t>
+struct CheckSimdReferenceValueType {
+  template <class SimdAbi>
+  void operator()() {
+    ex::simd<T, SimdAbi> origin_simd([](T i) { return static_cast<T>(i); });
----------------
philnik777 wrote:

Please add a test to make sure `operator value_type()` is `noexcept`.

https://github.com/llvm/llvm-project/pull/68960


More information about the libcxx-commits mailing list