Add asserts to ox::fs::Ptr

(synced from cfc95b2dd1)
This commit is contained in:
2018-03-05 23:07:40 -06:00
parent f0f95c1714
commit 25ff1afae9
+2
View File
@@ -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);
}