From eedd490e2d237edb06df54bc07362ff2c5dc2197 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 17 May 2022 21:16:58 +0200 Subject: [PATCH] net/AddressInfo: add iterator type aliases --- src/net/AddressInfo.hxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/net/AddressInfo.hxx b/src/net/AddressInfo.hxx index f38a7db97..7273cf97b 100644 --- a/src/net/AddressInfo.hxx +++ b/src/net/AddressInfo.hxx @@ -32,6 +32,7 @@ #include "SocketAddress.hxx" +#include #include #ifdef _WIN32 @@ -116,6 +117,12 @@ public: struct addrinfo *cursor; public: + using iterator_category = std::forward_iterator_tag; + using value_type = AddressInfo; + using difference_type = std::ptrdiff_t; + using pointer = const value_type *; + using reference = const value_type &; + explicit constexpr const_iterator(struct addrinfo *_cursor) noexcept :cursor(_cursor) {}