Skip to content

Commit d1c3cb9

Browse files
committed
Remove usage of the deprecated std::iterator in cmdline.h
This initial change is based on the types as they would be defined by `std::iterator`.
1 parent 6475b3c commit d1c3cb9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/util/cmdline.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,15 @@ class cmdlinet
105105
{
106106
explicit option_namest(const cmdlinet &command_line);
107107
struct option_names_iteratort
108-
: public std::iterator<std::forward_iterator_tag, std::string>
109108
{
109+
// These types are defined such that the class is compatible with being
110+
// treated as an STL iterator. For this to work, they must not be renamed.
111+
using iterator_category = std::forward_iterator_tag;
112+
using value_type = std::string;
113+
using difference_type = std::ptrdiff_t;
114+
using pointer = std::string *;
115+
using reference = std::string &;
116+
110117
option_names_iteratort() = default;
111118
explicit option_names_iteratort(
112119
const cmdlinet *command_line,

0 commit comments

Comments
 (0)