@@ -83,15 +83,15 @@ struct permutations_sized_adaptor
83
83
struct cursor_type {
84
84
std::vector<std::size_t > indices_;
85
85
std::vector<std::size_t > cycles_;
86
- std::size_t index_ ;
86
+ std::size_t permutation_index_ ;
87
87
88
88
[[nodiscard]] constexpr auto operator <=>(const cursor_type& other) const
89
89
{
90
- return index_ <=> other.index_ ;
90
+ return permutation_index_ <=> other.permutation_index_ ;
91
91
}
92
92
[[nodiscard]] constexpr bool operator ==(const cursor_type& other) const
93
93
{
94
- return index_ == other.index_ ;
94
+ return permutation_index_ == other.permutation_index_ ;
95
95
}
96
96
};
97
97
@@ -118,7 +118,7 @@ struct permutations_sized_adaptor
118
118
std::iota (cycles.rbegin (), cycles.rend (), base_length - SubsequenceSize);
119
119
120
120
// return the cursor
121
- return {.indices_ = indices, .cycles_ = cycles, .index_ = 0 };
121
+ return {.indices_ = indices, .cycles_ = cycles, .permutation_index_ = 0 };
122
122
}
123
123
124
124
static constexpr auto last (self_t & self) -> cursor_type
@@ -138,20 +138,20 @@ struct permutations_sized_adaptor
138
138
std::vector<std::size_t > cycles (SubsequenceSize, 0 );
139
139
140
140
// return the cursor
141
- return {.indices_ = indices, .cycles_ = cycles, .index_ = self.count_permutations ()};
141
+ return {.indices_ = indices, .cycles_ = cycles, .permutation_index_ = self.count_permutations ()};
142
142
}
143
143
144
144
static constexpr auto is_last (self_t & self, const cursor_type& cursor) -> bool
145
145
{
146
- return cursor.index_ >= self.count_permutations ();
146
+ return cursor.permutation_index_ >= self.count_permutations ();
147
147
}
148
148
149
149
static constexpr auto inc (self_t & self, cursor_type& cursor) -> void
150
150
{
151
151
const auto k = SubsequenceSize;
152
152
const auto n = self.cache_ .size ();
153
153
154
- cursor.index_ += 1 ;
154
+ cursor.permutation_index_ += 1 ;
155
155
156
156
for (const auto i : flux::iota (std::size_t {0 }, std::size_t {k}).reverse ()) {
157
157
if (cursor.cycles_ [i] == 0 ) {
0 commit comments