add const begin and end overload to buffer (#1553)

* add const begin and end overload to buffer

since there is a const overload for data I think there should also be one for begin and end
This commit is contained in:
dominicpoeschko 2020-02-19 14:59:50 +01:00 committed by GitHub
parent 3bafd0749b
commit 0415cf2350
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -633,6 +633,9 @@ template <typename T> class buffer {
T* begin() FMT_NOEXCEPT { return ptr_; } T* begin() FMT_NOEXCEPT { return ptr_; }
T* end() FMT_NOEXCEPT { return ptr_ + size_; } T* end() FMT_NOEXCEPT { return ptr_ + size_; }
const T* begin() const FMT_NOEXCEPT { return ptr_; }
const T* end() const FMT_NOEXCEPT { return ptr_ + size_; }
/** Returns the size of this buffer. */ /** Returns the size of this buffer. */
std::size_t size() const FMT_NOEXCEPT { return size_; } std::size_t size() const FMT_NOEXCEPT { return size_; }