From 8875982e1ff3c9ecd3b6a9bbb22981391b8b3327 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 24 Sep 2017 22:40:38 -0400 Subject: [PATCH] Ensures Sectors are move constructible (and still default constructible), and adds proper const qualifiers to Sector::Address. --- Storage/Disk/Encodings/MFM/Sector.hpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Storage/Disk/Encodings/MFM/Sector.hpp b/Storage/Disk/Encodings/MFM/Sector.hpp index 33b8132f4..2225f5bdd 100644 --- a/Storage/Disk/Encodings/MFM/Sector.hpp +++ b/Storage/Disk/Encodings/MFM/Sector.hpp @@ -27,7 +27,7 @@ struct Sector { struct Address { uint8_t track = 0, side = 0, sector = 0; - bool operator < (Address &rhs) { + bool operator < (const Address &rhs) const { return ((track << 24) | (side << 8) | sector) < ((rhs.track << 24) | (rhs.side << 8) | rhs.sector); } }; @@ -39,6 +39,16 @@ struct Sector { bool has_data_crc_error = false; bool has_header_crc_error = false; bool is_deleted = false; + + Sector() {} + + Sector(const Sector &&rhs) : + address(rhs.address), + size(rhs.size), + data(std::move(rhs.data)), + has_data_crc_error(rhs.has_data_crc_error), + has_header_crc_error(rhs.has_header_crc_error), + is_deleted(rhs.is_deleted ){} }; }