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

Michael Forster via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 15 23:32:56 PDT 2020


MForster added inline comments.


================
Comment at: llvm/include/llvm/ADT/Hashing.h:694
+      indices;
+  return hash_value_tuple_helper(arg, indices);
+}
----------------
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?


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