Fix -Wsign-conversion warnings

This commit is contained in:
Victor Zverovich
2020-03-25 07:46:00 -07:00
parent 664dd88e31
commit 96c68afe69
3 changed files with 28 additions and 22 deletions
+4 -2
View File
@@ -716,8 +716,10 @@ template <typename T> class buffer {
/** Appends data to the end of the buffer. */
template <typename U> void append(const U* begin, const U* end);
T& operator[](std::size_t index) { return ptr_[index]; }
const T& operator[](std::size_t index) const { return ptr_[index]; }
template <typename I> T& operator[](I index) { return ptr_[index]; }
template <typename I> const T& operator[](I index) const {
return ptr_[index];
}
};
// A container-backed buffer.