| 42 | FieldPosition child(int index) const { return {this, index}; } |
| 43 | |
| 44 | std::vector<int> path() const { |
| 45 | std::vector<int> path(depth_); |
| 46 | const FieldPosition* cur = this; |
| 47 | for (int i = depth_ - 1; i >= 0; --i) { |
| 48 | path[i] = cur->index_; |
| 49 | cur = cur->parent_; |
| 50 | } |
| 51 | return path; |
| 52 | } |
| 53 | |
| 54 | protected: |
| 55 | FieldPosition(const FieldPosition* parent, int index) |
no outgoing calls