Adapts a range so a range-based for loop can also observe the iteration index.
Declared in <folly/container/Enumerate.h>
template<class Range>
constexpr
/* implementation-defined */
enumerate(Range&& r);
Similar to Python's enumerate(): each iteration exposes both the running count and a reference to the current element. Usable in constexpr context.
A range adaptor yielding index/element pairs for r.
| Name | Description |
|---|---|
| r | The range to iterate over. |