Skip to content

Commit

Permalink
libcore|Range: Making a range with a start point and size
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jun 8, 2014
1 parent 793ea65 commit 9af23d9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions doomsday/libcore/include/de/core/range.h
Expand Up @@ -41,6 +41,7 @@ struct Range
Type end;

explicit Range(Type const &a = 0, Type const &b = 0) : start(a), end(b) {}
static Range fromSize(Type const &a, Type const &size) { return Range(a, a + size); }
inline bool isEmpty() const { return end == start; }
inline Type size() const { return end - start; }
inline bool contains(Type const &i) const { return i >= start && i < end; }
Expand Down

0 comments on commit 9af23d9

Please sign in to comment.