Skip to content

Commit 6046958

Browse files
committed
Move private section to the end of indexed_generate_n_iterator
1 parent 77cd2df commit 6046958

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

source/containers/algorithms/generate.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,6 @@ concept index_invocable = std::invocable<Function const &, generate_index_type<S
116116

117117
template<typename Offset, typename Function>
118118
struct indexed_generate_n_iterator {
119-
private:
120-
[[no_unique_address]] Offset m_offset;
121-
[[no_unique_address]] stored_function<Function const> m_generator;
122-
123-
public:
124119
using difference_type = decltype(bounded::declval<Offset>() - bounded::declval<Offset>());
125120

126121
constexpr indexed_generate_n_iterator(Offset const remaining, Function const & generator):
@@ -162,6 +157,9 @@ struct indexed_generate_n_iterator {
162157
friend constexpr auto operator-(indexed_generate_n_iterator const lhs, indexed_generate_n_iterator const rhs) -> difference_type {
163158
return lhs.m_offset - rhs.m_offset;
164159
}
160+
private:
161+
[[no_unique_address]] Offset m_offset;
162+
[[no_unique_address]] stored_function<Function const> m_generator;
165163
};
166164

167165
export template<typename Size, index_invocable<Size> Function>

0 commit comments

Comments
 (0)