[libcxx-commits] [libcxx] [libc++] implement `std::flat_multimap` (PR #113835)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Oct 27 13:18:57 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 0be1883c36fc19e4020fea12902481c3dd3436d2 5710932557e1a8cb64bbffdad42988f5973ae5de --extensions ,h,cpp,inc -- libcxx/include/__flat_map/flat_multimap.h libcxx/include/__flat_map/sorted_equivalent.h libcxx/test/std/containers/container.adaptors/flat.map.syn/sorted_equivalent.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/clear.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/emplace.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/emplace_hint.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/erase_iter.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/erase_iter_iter.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/erase_key.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/erase_key_transparent.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/extract.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/insert_cv.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/insert_initializer_list.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/insert_iter_cv.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/insert_iter_iter.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/insert_iter_rv.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/insert_or_assign.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/insert_or_assign_transparent.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/insert_range.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/insert_range_stability.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/insert_rv.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/insert_sorted_initializer_list.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/insert_sorted_iter_iter.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/insert_transparent.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/replace.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/swap_exception.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/swap_free.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/swap_member.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/try_emplace.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/try_emplace_transparent.pass.cpp libcxx/test/std/containers/container.adaptors/flat.multimap/helpers.h libcxx/include/flat_map libcxx/include/version libcxx/modules/std/flat_map.inc
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/include/flat_map b/libcxx/include/flat_map
index ac45a8abff..0e93387742 100644
--- a/libcxx/include/flat_map
+++ b/libcxx/include/flat_map
@@ -60,8 +60,8 @@ namespace std {
 #include <__config>
 #include <__flat_map/flat_map.h>
 #include <__flat_map/flat_multimap.h>
-#include <__flat_map/sorted_unique.h>
 #include <__flat_map/sorted_equivalent.h>
+#include <__flat_map/sorted_unique.h>
 #include <version>
 
 // standard required includes
diff --git a/libcxx/test/std/containers/container.adaptors/flat.map.syn/sorted_equivalent.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.map.syn/sorted_equivalent.pass.cpp
index d9ee3fbd28..559d0c2ff9 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.map.syn/sorted_equivalent.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.map.syn/sorted_equivalent.pass.cpp
@@ -29,15 +29,9 @@ static_assert(std::is_trivially_default_constructible_v<std::sorted_equivalent_t
 static_assert(!HasImplicitDefaultCtor<std::sorted_equivalent_t>);
 
 constexpr bool test() {
-  {
-    [[maybe_unused]] std::sorted_equivalent_t s;
-  }
-  {
-    [[maybe_unused]] std::same_as<const std::sorted_equivalent_t&> decltype(auto) s = (std::sorted_equivalent);
-  }
-  {
-    [[maybe_unused]] std::same_as<const std::sorted_equivalent_t> decltype(auto) copy = std::sorted_equivalent;
-  }
+  { [[maybe_unused]] std::sorted_equivalent_t s; }
+  { [[maybe_unused]] std::same_as<const std::sorted_equivalent_t&> decltype(auto) s = (std::sorted_equivalent); }
+  { [[maybe_unused]] std::same_as<const std::sorted_equivalent_t> decltype(auto) copy = std::sorted_equivalent; }
 
   return true;
 }
diff --git a/libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/insert_cv.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/insert_cv.pass.cpp
index c7ce679694..9af78d60b1 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/insert_cv.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.multimap/flat.map.modifiers/insert_cv.pass.cpp
@@ -47,14 +47,14 @@ void test() {
 
   const VT v3(3, 3.5);
   r = m.insert(v3);
-  assert(r == m.begin()+ 2);
+  assert(r == m.begin() + 2);
   assert(m.size() == 3);
   assert(r->first == 3);
   assert(r->second == 3.5);
 
   const VT v4(3, 4.5);
   r = m.insert(v4);
-  assert(r == m.begin()+ 2);
+  assert(r == m.begin() + 2);
   assert(m.size() == 4);
   assert(r->first == 3);
   assert(r->second == 4.5);

``````````

</details>


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


More information about the libcxx-commits mailing list