[libcxx-commits] [libcxx] [libc++] Implement P0429R9 `std::flat_map` (PR #98643)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Oct 18 11:15:36 PDT 2024
================
@@ -0,0 +1,74 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+
+// <flat_map>
+
+// flat_map iterators should be C++20 random access iterators
+// supporting `operator<=>`, even when the underlying container's
+// iterators are not.
+
+#include <compare>
+#include <concepts>
+#include <flat_map>
+#include <functional>
+
+#include "MinSequenceContainer.h"
+#include "test_macros.h"
+
+int main(int, char**) {
+// V is not a container as <=> is required
+#if 0
----------------
ldionne wrote:
In that case, it seems to me that this test should be modified to only check that `flat_map::iterator` provides the right comparisons, assuming the underlying container also does.
So the `#if 0` block can go away, and the comment at the top should change to say what we're testing.
https://github.com/llvm/llvm-project/pull/98643
More information about the libcxx-commits
mailing list