[libcxx-commits] [libcxx] [libc++] Implement std::move_only_function (P0288R9) (PR #94670)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Nov 21 08:21:02 PST 2025


================
@@ -0,0 +1,20 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: has-unix-headers
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
+
+#include <functional>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+  std::move_only_function<void()> func;
+  TEST_LIBCPP_ASSERT_FAILURE(func(), "Tried to call a disengaged move_only_function");
----------------
ldionne wrote:

`return 0;`

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


More information about the libcxx-commits mailing list