diff options
| author | Johannes Altmanninger <aclopte@gmail.com> | 2022-05-19 18:15:20 +0200 |
|---|---|---|
| committer | Johannes Altmanninger <aclopte@gmail.com> | 2022-05-21 15:10:03 +0200 |
| commit | 1529cfb2c2ce2247747cce5eadcc93dcee570e0e (patch) | |
| tree | 594f5068ff37762bdbd9d856944ba370ce4fba1e /src/string_utils.hh | |
| parent | 4c7c4a1454804ea978c527abe59be56dca0a1629 (diff) | |
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
Diffstat (limited to 'src/string_utils.hh')
| -rw-r--r-- | src/string_utils.hh | 8 |
1 files changed, 7 insertions, 1 deletions
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<std::forward_iterator_tag, StringView> + 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++(); |
