[libcxx-commits] [PATCH] D62779: [2/2] Fix complexity of map insert_or_assign with a hint.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Sep 17 11:56:34 PDT 2020


ldionne accepted this revision.
ldionne added a comment.
This revision is now accepted and ready to land.

LGTM, please:

1. Reduce your commit message to get rid of the benchmark output
2. Run: `for std in c++03 c++11 c++14 c++17 c++2a; do <build-dir>/bin/llvm-lit -sv libcxx/test/std/containers/associative/map --param std=$std; done` to make sure it all works

And the commit. Yay!



================
Comment at: libcxx/include/map:1276
+                                                        _Vp&& __v) {
+      auto [__r, __inserted] = __tree_.__emplace_hint_unique_key_args(
+          __h.__i_, __k, __k, _VSTD::forward<_Vp>(__v));
----------------
Mordante wrote:
> ldionne wrote:
> > You can't use structured bindings here, this is supposed to work before C++17.
> I used the structured bindings since the code is ifdef'ed at line 1204 with `#if _LIBCPP_STD_VER > 14` so I assumed it wasn't intended to be used prior to C++17. But no problem to use a pair.
Oh, my apologies. In that case that LGTM.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62779/new/

https://reviews.llvm.org/D62779



More information about the libcxx-commits mailing list