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.
105105* ` ival ` The interval to find.
106106* ` on_find ` A function of type bool(iterator) that is called when an interval was found.
107107Return 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+ ```
108117
109118** Returns** : An iterator to the found element, or std::end(tree).
110119
@@ -157,6 +166,15 @@ Finds the first interval in the interval tree that overlaps the given interval.
157166* ` on_find ` A function of type bool(iterator) that is called when an interval was found.
158167Return true to continue, false to preemptively abort search.
159168* ` 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+ ```
160178
161179** Returns** : An iterator to the found element, or std::end(tree).
162180
You can’t perform that action at this time.
0 commit comments