Adhere to formatting

This commit is contained in:
capitalistspz 2024-10-18 00:05:29 +01:00
parent 02bebde186
commit ce3357bcb7

View File

@ -98,30 +98,35 @@ class MEMPTR : MEMPTRBase
return MEMPTR<X>(this->m_value);
}
sint32 operator-(const MEMPTR& ptr) noexcept requires (!std::is_void_v<T>)
sint32 operator-(const MEMPTR& ptr) noexcept
requires(!std::is_void_v<T>)
{
return static_cast<sint32>(this->GetMPTR() - ptr.GetMPTR());
}
MEMPTR operator+(sint32 v) noexcept requires (!std::is_void_v<T>)
MEMPTR operator+(sint32 v) noexcept
requires(!std::is_void_v<T>)
{
// pointer arithmetic
return MEMPTR(this->GetMPTR() + v * sizeof(T));
}
MEMPTR operator-(sint32 v) noexcept requires (!std::is_void_v<T>)
MEMPTR operator-(sint32 v) noexcept
requires(!std::is_void_v<T>)
{
// pointer arithmetic
return MEMPTR(this->GetMPTR() - v * sizeof(T));
}
MEMPTR& operator+=(sint32 v) noexcept requires (!std::is_void_v<T>)
MEMPTR& operator+=(sint32 v) noexcept
requires(!std::is_void_v<T>)
{
m_value += v * sizeof(T);
return *this;
}
template<typename Q = T> requires (!std::is_void_v<Q>)
template<typename Q = T>
requires(!std::is_void_v<Q>)
Q& operator*() const noexcept
{
return *GetPtr();
@ -132,7 +137,8 @@ class MEMPTR : MEMPTRBase
return GetPtr();
}
template<typename Q = T> requires (!std::is_void_v<Q>)
template<typename Q = T>
requires(!std::is_void_v<Q>)
Q& operator[](int index) noexcept
{
return GetPtr()[index];