Kernel: Add non-const version of TypedMapping::operator->()

This commit is contained in:
Andreas Kling 2020-05-23 15:57:19 +02:00
parent 59a56a78c0
commit e870b936c3
Notes: sideshowbarker 2024-07-19 06:12:48 +09:00

View file

@ -36,6 +36,7 @@ struct TypedMapping {
const T* ptr() const { return reinterpret_cast<const T*>(region->vaddr().offset(offset).as_ptr()); }
T* ptr() { return reinterpret_cast<T*>(region->vaddr().offset(offset).as_ptr()); }
const T* operator->() const { return ptr(); }
T* operator->() { return ptr(); }
const T& operator*() const { return *ptr(); }
T& operator*() { return *ptr(); }
OwnPtr<Region> region;