Add asserts to ox::fs::Ptr
This commit is contained in:
parent
b616d9c0f2
commit
cfc95b2dd1
2
deps/ox/src/ox/fs/filestore/ptr.hpp
vendored
2
deps/ox/src/ox/fs/filestore/ptr.hpp
vendored
@ -71,6 +71,7 @@ inline size_t Ptr<T, size_t>::offset() const {
|
||||
|
||||
template<typename T, typename size_t>
|
||||
inline T *Ptr<T, size_t>::operator->() const {
|
||||
ox_assert(valid(), "Invalid pointer access. (ox::fs::Ptr::operator->())");
|
||||
return reinterpret_cast<T*>(m_dataStart + m_itemStart);
|
||||
}
|
||||
|
||||
@ -89,6 +90,7 @@ inline Ptr<T, size_t>::operator size_t() const {
|
||||
|
||||
template<typename T, typename size_t>
|
||||
inline T &Ptr<T, size_t>::operator*() const {
|
||||
ox_assert(valid(), "Invalid pointer dereference. (ox::fs::Ptr::operator*())");
|
||||
return *static_cast<T>(this);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user