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/parameters_parser.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/parameters_parser.hh')
| -rw-r--r-- | src/parameters_parser.hh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/parameters_parser.hh b/src/parameters_parser.hh index afc2c7dc..69fa88eb 100644 --- a/src/parameters_parser.hh +++ b/src/parameters_parser.hh @@ -80,8 +80,14 @@ struct ParametersParser // a non empty StringView value if the switch took an argument. Optional<StringView> get_switch(StringView name) const; - struct iterator : std::iterator<std::forward_iterator_tag, String> + struct iterator { + using difference_type = ptrdiff_t; + using value_type = String; + using pointer = String*; + using reference = String&; + using iterator_category = std::forward_iterator_tag; + iterator(const ParametersParser& parser, size_t index) : m_parser(parser), m_index(index) {} |
