Make the Rom class a little easier to use by allowing it to be copied around.

Signed-off-by: Adrian Conlon <adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon
2021-08-23 09:45:40 +01:00
parent 6bf28f1480
commit 6ffd8e5d0a
2 changed files with 11 additions and 0 deletions
+9
View File
@@ -44,6 +44,15 @@ void EightBit::Rom::poke(const uint16_t address, const uint8_t value) noexcept {
EightBit::Rom::Rom(const size_t size) noexcept
: m_bytes(size) {}
EightBit::Rom::Rom(const Rom& rhs)
: m_bytes(rhs.m_bytes) {}
EightBit::Rom& EightBit::Rom::operator=(const Rom& rhs) {
if (this != &rhs)
m_bytes = rhs.m_bytes;
return *this;
}
size_t EightBit::Rom::size() const noexcept {
return m_bytes.size();
}