[libcxx-commits] [libcxx] [libc++] implement std::flat_set (PR #125241)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 31 11:07:08 PST 2025


================
@@ -0,0 +1,69 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// flat_set& operator=(flat_set&&);
+
+#include <algorithm>
+#include <deque>
+#include <flat_set>
+#include <functional>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "test_macros.h"
+#include "MoveOnly.h"
+#include "../../../test_compare.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  {
+    using C  = test_less<int>;
+    using A1 = test_allocator<int>;
+    using M  = std::flat_set<int, C, std::vector<int, A1>>;
+    M mo     = M({1, 2, 3}, C(5), A1(7));
+    M m      = M({}, C(3), A1(7));
+    m        = std::move(mo);
----------------
ldionne wrote:

We need to test the return type and the return value here too.

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


More information about the libcxx-commits mailing list