From 661b4de5de15a867161132432849f1fe6f104f27 Mon Sep 17 00:00:00 2001 From: Ming-Hung Tsai Date: Tue, 28 Jul 2020 22:08:00 +0800 Subject: [PATCH] [run_set] Add lower_bound and upper_bound functions --- base/run_set.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/base/run_set.h b/base/run_set.h index 604daa8..3a1a769 100644 --- a/base/run_set.h +++ b/base/run_set.h @@ -92,6 +92,14 @@ namespace base { return runs_.end(); } + const_iterator lower_bound(T const &b) const { + return runs_.lower_bound(run(b, b + 1)); + } + + const_iterator upper_bound(T const &b) const { + return runs_.upper_bound(run(b, b + 1)); + } + void negate() { rset replacement;