Closed AaronBallman closed 5 years ago
My gut feeling:
ImageByteMap::getData()
now returns a std::optional<T>
instead of a T
so that callers can tell if they retrieved valid data.ByteMap
to see whether the given address and size would cause a region overlap. Then ImageByteData::setData()
can call that before setting individual elements in a loop.
This removes the explicit throws from our APIs. On error,
Open questions:
EXPECT_NO_THROW
(et al) calls in the testing code?My thoughts are:
setData(Addr Ea, size_t Bytes, std::byte Value)
andsetData(Addr Ea, const std::array<T, Size>& Data)
that will mutate part of the contained data and still return false, leaving the container in an unknown state.