[PATCH] D55760: [ADT] IntervalMap: add contains(a, b) method
Duncan P. N. Exon Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 18 13:41:44 PST 2018
dexonsmith added inline comments.
================
Comment at: unittests/ADT/IntervalMapTest.cpp:622
+ EXPECT_FALSE(map.overlaps(0, 9));
+ EXPECT_TRUE(map.overlaps(0, 10));
+ EXPECT_TRUE(map.overlaps(0, 15));
----------------
labath wrote:
> dexonsmith wrote:
> > I’m surprised this one returns true. Are these half-open intervals? If so I think you shouldn’t get overlap until you stop at 11.
> These are closed on both sides. Half-open intervals are tested below (where this indeed returns false). The half-openedness of an IntervalMap is controlled via template arguments (see line 17 and 18 in this file).
Got it; thanks for explaining!
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55760/new/
https://reviews.llvm.org/D55760
More information about the llvm-commits
mailing list