[libcxx-commits] [libcxx] [libc++] P3168R2 Give std::optional Range Support (PR #146491)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jul 1 06:35:20 PDT 2025
================
@@ -0,0 +1,19 @@
+//===----------------------------------------------------------------------===//
+//
+// 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: std-at-least-c++26
+
+#include "assert_macros.h"
+#include <optional>
+
+int main() {
+ std::optional<int> val = 2;
+ auto end = val.end();
+ TEST_DOES_NOT_THROW(*end);
+ return 0;
+}
----------------
philnik777 wrote:
Missing newline.
https://github.com/llvm/llvm-project/pull/146491
More information about the libcxx-commits
mailing list