[llvm][ADT] Allow using structured bindings with `llvm::enumerate`
This patch adds the ability to deconstruct the `value_type` returned by `llvm::enumarate` into index and value of the wrapping range. Main use case is the common occurence of using it during loop iteration. After this patch it'd then be possible to write code such as: ``` for (auto [index, value] : enumerate(container)) { ... } ``` where `index` is the current index and `value` a reference to elements in the given container. Differential Revision: https://reviews.llvm.org/D131486
Loading
Please sign in to comment