summaryrefslogtreecommitdiff
path: root/src/protocol
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-09-02 07:57:08 +0200
committerMax Kellermann <max@musicpd.org>2018-09-02 08:17:22 +0200
commit2915d2dd0f80aed4db1e362e3688a044fc5ce919 (patch)
tree541491a4715cf6d907ea3c048da25aca56f4e962 /src/protocol
parent590687fdea671c964445585b67209bacf5cfe876 (diff)
protocol/RangeArg: add IsAll()
Diffstat (limited to 'src/protocol')
-rw-r--r--src/protocol/RangeArg.hxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/protocol/RangeArg.hxx b/src/protocol/RangeArg.hxx
index e6a8de8ff..796c25959 100644
--- a/src/protocol/RangeArg.hxx
+++ b/src/protocol/RangeArg.hxx
@@ -30,6 +30,18 @@ struct RangeArg {
static constexpr RangeArg All() {
return { 0, std::numeric_limits<unsigned>::max() };
}
+
+ constexpr bool operator==(RangeArg other) const noexcept {
+ return start == other.start && end == other.end;
+ }
+
+ constexpr bool operator!=(RangeArg other) const noexcept {
+ return !(*this == other);
+ }
+
+ constexpr bool IsAll() const noexcept {
+ return *this == All();
+ }
};
#endif