[libcxx-commits] [libcxx] [libc++] implement std::flat_set (PR #125241)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Mar 14 13:38:32 PDT 2025
================
@@ -0,0 +1,73 @@
+//===----------------------------------------------------------------------===//
+//
+// 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_set>
+
+// size_type count(const key_type& x) const;
+
+#include <cassert>
+#include <deque>
+#include <flat_set>
+#include <functional>
+#include <utility>
+
+#include "MinSequenceContainer.h"
+#include "test_macros.h"
+#include "min_allocator.h"
+
+template <class KeyContainer>
+void test_one() {
+ using Key = typename KeyContainer::value_type;
+ using S = typename KeyContainer::size_type;
+
+ {
+ using M = std::flat_set<Key, std::less<>, KeyContainer>;
+ M m = {1, 2, 4, 5, 8};
----------------
ldionne wrote:
Same, let's test on an empty `flat_set`.
https://github.com/llvm/llvm-project/pull/125241
More information about the libcxx-commits
mailing list