From 1529cfb2c2ce2247747cce5eadcc93dcee570e0e Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Thu, 19 May 2022 18:15:20 +0200 Subject: Stop using deprecated std::iterator As reported in #4615 and others, GCC 12.1 emits deprecation warnings because we use std::iterator. Replace it with the modern equivalent. Closes #4615 --- src/string_utils.hh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/string_utils.hh') diff --git a/src/string_utils.hh b/src/string_utils.hh index 1c2d4076..b2dc3d30 100644 --- a/src/string_utils.hh +++ b/src/string_utils.hh @@ -68,8 +68,14 @@ String expand_tabs(StringView line, ColumnCount tabstop, ColumnCount col = 0); struct WrapView { - struct Iterator : std::iterator + struct Iterator { + using difference_type = ptrdiff_t; + using value_type = StringView; + using pointer = StringView*; + using reference = StringView&; + using iterator_category = std::forward_iterator_tag; + Iterator(StringView text, ColumnCount max_width); Iterator& operator++(); -- cgit v1.2.3