[PATCH] D146893: [ADT] Work around MSVC bug affecting `get(enumerator_result)`

Jakub Kuderski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 28 08:46:07 PDT 2023


kuhar marked an inline comment as done.
kuhar added inline comments.


================
Comment at: llvm/include/llvm/ADT/STLExtras.h:2323
+  template <std::size_t I, typename = std::enable_if_t<I != 0>>
+  friend std::tuple_element_t<I, value_reference_tuple>
+  get(const enumerator_result &Result) {
----------------
probinson wrote:
> Tuple index should be decremented, yes?
No, it's should be as-is. `value_reference_tuple` includes index as the first element, which is not the case for `Storage`.

Alternatively, we could have `std::tuple_element_t<I - 1, range_reference_tuple>`, but that shouldn't change anything.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146893



More information about the llvm-commits mailing list