common/threadsafe_queue: Apply nodiscard where applicable

This commit is contained in:
Lioncash
2019-04-15 13:24:39 -04:00
parent 737fafef56
commit 5ef9259e64

View File

@@ -25,15 +25,15 @@ public:
delete read_ptr; delete read_ptr;
} }
std::size_t Size() const { [[nodiscard]] std::size_t Size() const {
return size.load(); return size.load();
} }
bool Empty() const { [[nodiscard]] bool Empty() const {
return Size() == 0; return Size() == 0;
} }
T& Front() const { [[nodiscard]] T& Front() const {
return read_ptr->current; return read_ptr->current;
} }
@@ -123,15 +123,15 @@ private:
template <typename T> template <typename T>
class MPSCQueue { class MPSCQueue {
public: public:
std::size_t Size() const { [[nodiscard]] std::size_t Size() const {
return spsc_queue.Size(); return spsc_queue.Size();
} }
bool Empty() const { [[nodiscard]] bool Empty() const {
return spsc_queue.Empty(); return spsc_queue.Empty();
} }
T& Front() const { [[nodiscard]] T& Front() const {
return spsc_queue.Front(); return spsc_queue.Front();
} }