From a4019cb6aaf5e3e73c7e65112668c5af648a315c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 7 Aug 2017 16:18:43 +0200 Subject: [PATCH] util/StringBuffer: use std::array::const_iterator --- src/util/StringBuffer.hxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/util/StringBuffer.hxx b/src/util/StringBuffer.hxx index d58990090..1ef562684 100644 --- a/src/util/StringBuffer.hxx +++ b/src/util/StringBuffer.hxx @@ -42,15 +42,17 @@ public: typedef T &reference; typedef T *pointer; typedef const T *const_pointer; - typedef const_pointer const_iterator; typedef size_t size_type; static constexpr value_type SENTINEL = '\0'; protected: - std::array the_data; + typedef std::array Array; + Array the_data; public: + typedef typename Array::const_iterator const_iterator; + constexpr size_type capacity() const { return CAPACITY; } @@ -72,7 +74,7 @@ public: } constexpr value_type front() const { - return c_str()[0]; + return the_data.front(); } /** @@ -90,11 +92,11 @@ public: } constexpr const_iterator begin() const { - return the_data; + return the_data.begin(); } constexpr const_iterator end() const { - return the_data + capacity(); + return the_data.end(); } constexpr operator const_pointer() const {