@@ -315,7 +315,18 @@ Returns a past the end const_iterator in reverse.
315
315
** Returns** : past the end const_iterator.
316
316
317
317
## Members of Interval
318
- ___ You can implement your own interval if you provide all the same functions.___
318
+ ___ You can implement your own interval if you provide the same functions, except (within, operator-, size, operator!=).___
319
+
320
+ There are 6 types of intervals:
321
+ - open: (a, b)
322
+ - left_open: (a, b]
323
+ - right_open: [ a, b)
324
+ - closed: [ a, b]
325
+ - closed_adjacent: [ a, b] (counts adjacent intervals as overlapping)
326
+ - dynamic: Can be any of the above, depending on the input.
327
+
328
+ Which can be picked with the second template parameter of interval:
329
+ ` lib_interval_tree::interval<int, lib_interval_tree::open> `
319
330
320
331
- [ Members of Interval] ( #members-of-interval )
321
332
- [ using value_type] ( #using-value_type )
@@ -324,7 +335,7 @@ ___You can implement your own interval if you provide all the same functions.___
324
335
- [ friend bool operator!=(interval const& lhs, interval const& other)] ( #friend-bool-operatorinterval-const-lhs-interval-const-other-1 )
325
336
- [ value_type low() const] ( #value_type-low-const )
326
337
- [ value_type high() const] ( #value_type-high-const )
327
- - [ bool overlaps(value_type l, value_type h) const] ( #bool-overlapsvalue_type-l-value_type-h-const )
338
+ - [ \[\[ deprecated \]\] bool overlaps(value_type l, value_type h) const] ( #bool-overlapsvalue_type-l-value_type-h-const )
328
339
- [ bool overlaps_exclusive(value_type l, value_type h) const] ( #bool-overlaps_exclusivevalue_type-l-value_type-h-const )
329
340
- [ bool overlaps(interval const& other) const] ( #bool-overlapsinterval-const-other-const )
330
341
- [ bool overlaps_exclusive(interval const& other) const] ( #bool-overlaps_exclusiveinterval-const-other-const )
@@ -346,22 +357,23 @@ Comparison operator.
346
357
Lower bound.
347
358
### value_type high() const
348
359
Upper bound.
349
- ### bool overlaps(value_type l, value_type h) const
360
+ ### \[\[ deprecated \]\] bool overlaps(value_type l, value_type h) const
350
361
Overlap these bounds with this interval (closed)?
362
+ Is deprecated because the overlapping only works with closed intervals.
351
363
### bool overlaps_exclusive(value_type l, value_type h) const
352
364
Overlap these bounds with this interval excluding borders?
353
365
### bool overlaps(interval const& other) const
354
366
Like overlaps with lower and upper bound.
355
367
### bool overlaps_exclusive(interval const& other) const
356
368
Like overlaps with lower and upper bound.
357
369
### bool within(value_type value) const
358
- Is the value within the interval (closed) ?
370
+ Is the value within the interval?
359
371
### bool within(interval const& other) const
360
372
Is the interval within the interval?
361
373
### value_type operator-(interval const& other) const
362
374
Calculates the distance between the two intervals.
363
375
Overlapping intervals have 0 distance.
364
376
### value_type size() const
365
- Returns high - low .
377
+ Returns The amount of elements in the interval when integral, or the distance between the 2 bounds when floating point .
366
378
### interval join(interval const& other) const
367
379
Joins 2 intervals and whatever is inbetween.
0 commit comments