@@ -117,7 +117,10 @@ template<class Struct, class Order>
117
117
struct traverser_t : contain<Struct, Order> {
118
118
using contain<Struct, Order>::contain;
119
119
120
+ [[nodiscard(" returns a copy of the underlying struct" )]]
120
121
constexpr auto get_struct () const noexcept { return this ->template get <0 >(); }
122
+
123
+ [[nodiscard(" returns a copy of the underlying order" )]]
121
124
constexpr auto get_order () const noexcept { return this ->template get <1 >(); }
122
125
123
126
[[nodiscard(" returns a new traverser" )]]
@@ -152,10 +155,12 @@ struct traverser_t : contain<Struct, Order> {
152
155
for_each_impl (dim_tree_from_sequence<dim_sequence<Dims...>>(), f, empty_state);
153
156
}
154
157
158
+ [[nodiscard(" construct an object representing the state of the traverser" )]]
155
159
constexpr auto state () const noexcept {
156
160
return state_at<Struct>(top_struct (), empty_state);
157
161
}
158
162
163
+ [[nodiscard(" returns a copy of the top struct (combination of the underlying struct and order)" )]]
159
164
constexpr auto top_struct () const noexcept {
160
165
return get_struct () ^ get_order ();
161
166
}
@@ -219,6 +224,7 @@ template<class T>
219
224
concept IsTraverser = is_traverser_v<T>;
220
225
221
226
template <IsTraverser T>
227
+ [[nodiscard(" returns a new traverser" )]]
222
228
constexpr auto operator ^(const T &t, IsProtoStruct auto order) noexcept {
223
229
return t.order (order);
224
230
}
0 commit comments