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/parameters_parser.hh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/parameters_parser.hh') 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 get_switch(StringView name) const; - struct iterator : std::iterator + 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) {} -- cgit v1.2.3