File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,11 @@ class YG_EXPORT Node : public ::YGNode {
35
35
public:
36
36
using Backtrack = std::vector<std::pair<const Node*, size_t >>;
37
37
struct Iterator {
38
- using iterator_category = std::forward_iterator_tag;
38
+ using iterator_category = std::input_iterator_tag;
39
+ using difference_type = std::ptrdiff_t ;
40
+ using value_type = Node*;
41
+ using pointer = Node*;
42
+ using reference = Node*;
39
43
40
44
Iterator (const Node* node, size_t childIndex)
41
45
: node_(node), childIndex_(childIndex) {}
@@ -133,7 +137,9 @@ class YG_EXPORT Node : public ::YGNode {
133
137
friend LayoutableChildren;
134
138
};
135
139
136
- LayoutableChildren (const Node* node) : node_(node) {}
140
+ LayoutableChildren (const Node* node) : node_(node) {
141
+ static_assert (std::input_iterator<LayoutableChildren::Iterator>);
142
+ }
137
143
138
144
Iterator begin () const {
139
145
if (node_->getChildCount () > 0 ) {
@@ -267,6 +273,7 @@ class YG_EXPORT Node : public ::YGNode {
267
273
}
268
274
269
275
const LayoutableChildren getLayoutChildren () const {
276
+ static_assert (std::input_iterator<LayoutableChildren::Iterator>);
270
277
return LayoutableChildren (this );
271
278
}
272
279
You can’t perform that action at this time.
0 commit comments