[PATCH] D131486: [llvm][ADT] Allow using structured bindings with `llvm::enumerate`

Jakub Kuderski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 9 08:25:05 PDT 2022


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

Looks good to me, but I'm not 100% sure about const/ref correctness. Please wait for a second approval before submitting (e.g., from @dblaikie).



================
Comment at: llvm/unittests/ADT/STLExtrasTest.cpp:44
 
+using testing::ElementsAre;
+
----------------
nit: I think it's more common to have this just after `using namespace llvm;`


================
Comment at: llvm/unittests/ADT/STLExtrasTest.cpp:142
+
+  for (auto [index, value] :
+       llvm::enumerate(std::vector<char>{'1', '2', '3'})) {
----------------
I'm surprised this doesn't require `auto&& [index, value]`, but this seems consistent with the existing behavior with `X.value()`


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

https://reviews.llvm.org/D131486



More information about the llvm-commits mailing list