Since c
is of type const Cache *
, you can only call const
member functions on it.
You have two options:
(1) remove const
from the declaration of c
;
(2) change Cache::write()
like so:
bool write(const MemoryAccess &memory_access, CacheLine &cl) const;
(Note the added const
at the end.)