Skip to content

Commit

Permalink
add const begin and end overload to buffer (#1553)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
dominicpoeschko authored Feb 19, 2020
1 parent 3bafd07 commit 0415cf2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/fmt/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,9 @@ template <typename T> class buffer {
T* begin() FMT_NOEXCEPT { return ptr_; }
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. */
std::size_t size() const FMT_NOEXCEPT { return size_; }

Expand Down

0 comments on commit 0415cf2

Please sign in to comment.