diff options
author | Max Kellermann <max@musicpd.org> | 2019-08-02 22:49:08 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-08-02 22:49:33 +0200 |
commit | adc25e648fe5237694d237fd781d4705bf01bbd4 (patch) | |
tree | a16c6cb995dfde70ca3f2da36d6a826b84ee30c0 | |
parent | 31da8eac9b9324ab09645fa73dc84dc7cc6013d7 (diff) |
util/StaticFifoBuffer: add `constexpr`
-rw-r--r-- | src/util/StaticFifoBuffer.hxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/StaticFifoBuffer.hxx b/src/util/StaticFifoBuffer.hxx index bf74a22c8..3598d7246 100644 --- a/src/util/StaticFifoBuffer.hxx +++ b/src/util/StaticFifoBuffer.hxx @@ -78,11 +78,11 @@ public: head = tail = 0; } - bool empty() const noexcept { + constexpr bool empty() const noexcept { return head == tail; } - bool IsFull() const noexcept { + constexpr bool IsFull() const noexcept { return head == 0 && tail == size; } @@ -115,7 +115,7 @@ public: * Return a buffer range which may be read. The buffer pointer is * writable, to allow modifications while parsing. */ - Range Read() noexcept { + constexpr Range Read() noexcept { return Range(data + head, tail - head); } |