[libcxx-commits] [libcxx] [libc++] Implement P0429R9 `std::flat_map` (PR #98643)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Sep 27 12:22:22 PDT 2024


================
@@ -0,0 +1,133 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+//       mapped_type& at(const key_type& k);
+// const mapped_type& at(const key_type& k) const;
+
+#include <cassert>
+#include <flat_map>
+#include <functional>
+#include <stdexcept>
+#include <vector>
+
+#include "min_allocator.h"
+#include "test_macros.h"
+
+int main(int, char**) {
+  using P = std::pair<int, double>;
----------------
ldionne wrote:

I would suggest parameterizing your tests (probably most of them can be) on the key container and the value container. That way, you can instantiate the tests with a few common containers, including a minimal container archetype.

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


More information about the libcxx-commits mailing list