[PATCH] D83887: Add hashing support for std::tuple

Dmitri Gribenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 03:57:38 PDT 2020


gribozavr2 accepted this revision.
gribozavr2 marked an inline comment as done.
gribozavr2 added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/include/llvm/ADT/Hashing.h:694
+      indices;
+  return hash_value_tuple_helper(arg, indices);
+}
----------------
MForster wrote:
> gribozavr2 wrote:
> > Could you add a TODO to replace this custom machinery with a call to std::apply when LLVM starts using C++17?
> > 
> > Right now in C++14 I think we can use `std::index_sequence_for` instead of `MakeTupleIndexSet`. The helper can also be moved from a side namespace into a local lambda.
> Added a TODO and used `std::index_sequence_for`. That's neat.
> 
> > The helper can also be moved from a side namespace into a local lambda.
> 
> How would you do that? I know that you can use `auto` to create a generic lambda, but how do you destructure the type to extract the `Indices` type parameter?
Ah right, we need a named template parameter type pack.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83887





More information about the llvm-commits mailing list