Bound-STL attempts to implement Rust copy of lower_bound
and upper_bound
manners in C++ STL.
This implementation is adding two traits LowerBound
and UpperBound
to the follow structures:
- [..]
- Vec
- VecDeque
- BinaryHeap
- BTreeset
- BTreeMap
This repo hosts at bound-stl
```rust use bound_stl::LowerBound;
let v = vec![1, 2, 3, 4, 5]; asserteq!(v.lowerbound(&3), Ok(2)); asserteq!(v.lowerbound(&6), Err(5));
use bound_stl::UpperBound;
let v = vec![1, 2, 3, 4, 5]; asserteq!(v.upperbound(&3), Ok(3)); asserteq!(v.upperbound(&6), Err(5));
```