protocol/RangeArg: add Contains()

This commit is contained in:
Max Kellermann
2018-09-02 07:57:36 +02:00
parent 2915d2dd0f
commit 15b2a4862e
2 changed files with 5 additions and 3 deletions

View File

@@ -42,6 +42,10 @@ struct RangeArg {
constexpr bool IsAll() const noexcept {
return *this == All();
}
constexpr bool Contains(unsigned i) const noexcept {
return i >= start && i < end;
}
};
#endif