[libcxx-commits] [libcxx] [libc++][numeric] P0543R3: Saturation arithmetic (PR #77967)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jan 13 08:00:24 PST 2024


================
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++20, c++23
+
+// <numeric>
+
+// template<class T>
+// constexpr T mul_sat(T x, T y) noexcept;                     // freestanding
+
+#include <cstdint>
+#include <numeric>
+
+#include "test_macros.h"
+
+template <typename IntegerT>
+constexpr void test_constraint() {
----------------
philnik777 wrote:

This should be SFINAE tested instead AFAICT. Same for the other `.verify.cpp` tests.

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


More information about the libcxx-commits mailing list