DataReader: Make size() and Peek() const member functions

These don't modify class state, so they can be const qualified.
This commit is contained in:
Lioncash 2018-03-18 16:18:38 -04:00
parent 0c128f3abe
commit fd956f6c69
1 changed files with 2 additions and 2 deletions

View File

@ -22,9 +22,9 @@ public:
return src;
}
__forceinline size_t size() { return end - buffer; }
__forceinline size_t size() const { return end - buffer; }
template <typename T, bool swapped = true>
__forceinline T Peek(int offset = 0)
__forceinline T Peek(int offset = 0) const
{
T data;
std::memcpy(&data, &buffer[offset], sizeof(T));