Skip to content

Commit e70830a

Browse files
committed
Update CMemoryView class
1 parent df592b1 commit e70830a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

include/dynlibutils/memaddr.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,9 @@ class CMemoryView : public CMemory
245245
public:
246246
using CBase = CMemory;
247247
using CBase::CBase;
248+
using CBase::m_addr;
248249

249-
constexpr CMemoryView& operator=(const CMemory& copyFrom) noexcept { static_cast<CBase>(*this) = copyFrom; };
250+
constexpr CMemoryView& operator=(const CMemory& copyFrom) noexcept { static_cast<CBase>(*this) = copyFrom; return *this; };
250251

251252
using Element_t = T;
252253
using CThis = CMemoryView<T>;
@@ -271,8 +272,8 @@ class CMemoryView : public CMemory
271272
constexpr T Get() const { return GetRef(); }
272273

273274
/// Offset methods (view ones; operators are used).
274-
CThis Offset(std::ptrdiff_t offset) const noexcept { return CThis(reinterpret_cast<T *>(CBase::m_addr) + offset); }
275-
CThis& OffsetSelf(std::ptrdiff_t offset) noexcept { reinterpret_cast<T *>(CBase::m_addr) += offset; return *this; }
275+
CThis Offset(std::ptrdiff_t offset) const noexcept { return CThis(reinterpret_cast<T *>(m_addr) + offset); }
276+
CThis& OffsetSelf(std::ptrdiff_t offset) noexcept { reinterpret_cast<T *>(m_addr) += offset; return *this; }
276277
}; // class CMemoryView
277278

278279
} // namespace DynLibUtils

0 commit comments

Comments
 (0)