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:
parent
0c128f3abe
commit
fd956f6c69
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue