net/AddressInfo: add iterator type aliases
This commit is contained in:
parent
0a8aca516a
commit
eedd490e2d
@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
#include "SocketAddress.hxx"
|
#include "SocketAddress.hxx"
|
||||||
|
|
||||||
|
#include <iterator>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@ -116,6 +117,12 @@ public:
|
|||||||
struct addrinfo *cursor;
|
struct addrinfo *cursor;
|
||||||
|
|
||||||
public:
|
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
|
explicit constexpr const_iterator(struct addrinfo *_cursor) noexcept
|
||||||
:cursor(_cursor) {}
|
:cursor(_cursor) {}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user