We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9587afc commit 1fb1339Copy full SHA for 1fb1339
src/modm/math/algorithm/enumerate.hpp
@@ -12,8 +12,10 @@
12
13
#pragma once
14
15
-#include <stdint.h>
+#include <cstdint>
16
+#include <ranges>
17
#include <tuple>
18
+#include <utility>
19
20
namespace modm
21
{
@@ -31,7 +33,10 @@ constexpr auto enumerate(T && iterable)
31
33
TIter iter;
32
34
constexpr bool operator != (const iterator & other) const { return iter != other.iter; }
35
constexpr void operator ++ () { ++i; ++iter; }
- constexpr auto operator * () const { return std::tie(i, *iter); }
36
+ constexpr auto operator * () const
37
+ {
38
+ return std::tuple<size_t, std::ranges::range_reference_t<T>>{i, *iter};
39
+ }
40
};
41
struct iterable_wrapper
42
0 commit comments