aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zencore/include/zencore/memory.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/zencore/include/zencore/memory.h b/zencore/include/zencore/memory.h
index 1f948d3bb..9d6339595 100644
--- a/zencore/include/zencore/memory.h
+++ b/zencore/include/zencore/memory.h
@@ -83,10 +83,10 @@ struct MutableMemoryView
{
}
- inline bool IsEmpty() const { return m_Data == m_DataEnd; }
- void* GetData() const { return m_Data; }
- void* GetDataEnd() const { return m_DataEnd; }
- constexpr size_t GetSize() const { return reinterpret_cast<uint8_t*>(m_DataEnd) - reinterpret_cast<uint8_t*>(m_Data); }
+ inline bool IsEmpty() const { return m_Data == m_DataEnd; }
+ void* GetData() const { return m_Data; }
+ void* GetDataEnd() const { return m_DataEnd; }
+ size_t GetSize() const { return reinterpret_cast<uint8_t*>(m_DataEnd) - reinterpret_cast<uint8_t*>(m_Data); }
inline bool EqualBytes(const MutableMemoryView& InView) const
{
@@ -113,7 +113,7 @@ struct MutableMemoryView
}
/** Modifies the view by chopping the given number of bytes from the left. */
- inline constexpr void RightChopInline(uint64_t InSize)
+ inline void RightChopInline(uint64_t InSize)
{
const uint64_t Offset = zen::Min(GetSize(), InSize);
m_Data = GetDataAtOffsetNoCheck(Offset);
@@ -153,7 +153,7 @@ struct MutableMemoryView
return View;
}
- inline constexpr MutableMemoryView& operator+=(size_t InSize)
+ inline MutableMemoryView& operator+=(size_t InSize)
{
RightChopInline(InSize);
return *this;
@@ -194,11 +194,11 @@ struct MemoryView
{
}
- inline bool Contains(const MemoryView& Other) const { return (m_Data <= Other.m_Data) && (m_DataEnd >= Other.m_DataEnd); }
- inline bool IsEmpty() const { return m_Data == m_DataEnd; }
- const void* GetData() const { return m_Data; }
- const void* GetDataEnd() const { return m_DataEnd; }
- constexpr size_t GetSize() const { return reinterpret_cast<const uint8_t*>(m_DataEnd) - reinterpret_cast<const uint8_t*>(m_Data); }
+ inline bool Contains(const MemoryView& Other) const { return (m_Data <= Other.m_Data) && (m_DataEnd >= Other.m_DataEnd); }
+ inline bool IsEmpty() const { return m_Data == m_DataEnd; }
+ const void* GetData() const { return m_Data; }
+ const void* GetDataEnd() const { return m_DataEnd; }
+ size_t GetSize() const { return reinterpret_cast<const uint8_t*>(m_DataEnd) - reinterpret_cast<const uint8_t*>(m_Data); }
inline bool operator==(const MemoryView& Rhs) const { return m_Data == Rhs.m_Data && m_DataEnd == Rhs.m_DataEnd; }
inline bool EqualBytes(const MemoryView& InView) const
@@ -208,14 +208,14 @@ struct MemoryView
return Size == InView.GetSize() && (memcmp(m_Data, InView.GetData(), Size) == 0);
}
- inline constexpr MemoryView& operator+=(size_t InSize)
+ inline MemoryView& operator+=(size_t InSize)
{
RightChopInline(InSize);
return *this;
}
/** Modifies the view by chopping the given number of bytes from the left. */
- inline constexpr void RightChopInline(uint64_t InSize)
+ inline void RightChopInline(uint64_t InSize)
{
const uint64_t Offset = std::min(GetSize(), InSize);
m_Data = GetDataAtOffsetNoCheck(Offset);
@@ -246,7 +246,7 @@ struct MemoryView
}
/** Returns the left-most part of the view by taking the given number of bytes from the left. */
- constexpr inline MemoryView Left(uint64_t InSize) const
+ inline MemoryView Left(uint64_t InSize) const
{
MemoryView View(*this);
View.LeftInline(InSize);
@@ -254,7 +254,7 @@ struct MemoryView
}
/** Modifies the view to be the given number of bytes from the left. */
- constexpr inline void LeftInline(uint64_t InSize)
+ inline void LeftInline(uint64_t InSize)
{
InSize = zen::Min(GetSize(), InSize);
m_DataEnd = std::min(m_DataEnd, m_Data + InSize);
@@ -298,28 +298,28 @@ MutableMemoryView::CopyFrom(MemoryView InView) const
}
/** Advances the start of the view by an offset, which is clamped to stay within the view. */
-constexpr inline MemoryView
+inline MemoryView
operator+(const MemoryView& View, uint64_t Offset)
{
return MemoryView(View) += Offset;
}
/** Advances the start of the view by an offset, which is clamped to stay within the view. */
-constexpr inline MemoryView
+inline MemoryView
operator+(uint64_t Offset, const MemoryView& View)
{
return MemoryView(View) += Offset;
}
/** Advances the start of the view by an offset, which is clamped to stay within the view. */
-constexpr inline MutableMemoryView
+inline MutableMemoryView
operator+(const MutableMemoryView& View, uint64_t Offset)
{
return MutableMemoryView(View) += Offset;
}
/** Advances the start of the view by an offset, which is clamped to stay within the view. */
-constexpr inline MutableMemoryView
+inline MutableMemoryView
operator+(uint64_t Offset, const MutableMemoryView& View)
{
return MutableMemoryView(View) += Offset;