File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,15 @@ Find all intervals in the tree matching ival.
105
105
* ` ival ` The interval to find.
106
106
* ` on_find ` A function of type bool(iterator) that is called when an interval was found.
107
107
Return true to continue, false to preemptively abort search.
108
+ #### Example
109
+ ``` c++
110
+ tree.insert({3, 7});
111
+ tree.insert({3, 7});
112
+ tree.insert({8, 9});
113
+ tree.find_all({3, 7}, [ ] (auto iter) /* iter will be const_iterator if tree is const * / {
114
+ // will find all intervals that are exactly {3,7} here.
115
+ });
116
+ ```
108
117
109
118
** Returns** : An iterator to the found element, or std::end(tree).
110
119
@@ -157,6 +166,15 @@ Finds the first interval in the interval tree that overlaps the given interval.
157
166
* ` on_find ` A function of type bool(iterator) that is called when an interval was found.
158
167
Return true to continue, false to preemptively abort search.
159
168
* ` exclusive ` Exclude borders from overlap check. Defaults to false.
169
+ #### Example
170
+ ``` c++
171
+ tree.insert({0, 5});
172
+ tree.insert({5, 10});
173
+ tree.insert({10, 15});
174
+ tree.overlap_find_all({5, 5}, [ ] (auto iter) /* iter will be const_iterator if tree is const * / {
175
+ // called with {0, 5} and {5, 10} in unspecified order.
176
+ });
177
+ ```
160
178
161
179
** Returns** : An iterator to the found element, or std::end(tree).
162
180
You can’t perform that action at this time.
0 commit comments