From 8049b8beb625686a4edd9fd1bdf133496e6f462c Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 29 Oct 2020 22:55:56 -0400 Subject: [PATCH] common/stream: Be explicit with copy and move operators --- src/common/stream.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/common/stream.h b/src/common/stream.h index 2585c16af9..0e40692de1 100644 --- a/src/common/stream.h +++ b/src/common/stream.h @@ -21,6 +21,12 @@ public: explicit Stream(); ~Stream(); + Stream(const Stream&) = delete; + Stream& operator=(const Stream&) = delete; + + Stream(Stream&&) = default; + Stream& operator=(Stream&&) = default; + /// Reposition bitstream "cursor" to the specified offset from origin void Seek(s32 offset, SeekOrigin origin); @@ -30,15 +36,15 @@ public: /// Writes byte at current position void WriteByte(u8 byte); - std::size_t GetPosition() const { + [[nodiscard]] std::size_t GetPosition() const { return position; } - std::vector& GetBuffer() { + [[nodiscard]] std::vector& GetBuffer() { return buffer; } - const std::vector& GetBuffer() const { + [[nodiscard]] const std::vector& GetBuffer() const { return buffer; }