The class template basic_address_iterator enables iteration over IP addresses in network byte order. This clause defines two specializations of the class template basic_address_iterator: basic_address_iterator<address_v4> and basic_address_iterator<address_v6>. The members and operational semantics of these specializations are defined below.
namespace std {
namespace experimental {
namespace net {
inline namespace v1 {
namespace ip {
template<> class basic_address_iterator<Address>
{
public:
// types:
using value_type = Address;
using difference_type = ptrdiff_t;
using pointer = const Address*;
using reference = const Address&;
using iterator_category = input_iterator_tag;
// constructors:
basic_address_iterator(const Address& a) noexcept;
// members:
reference operator*() const noexcept;
pointer operator->() const noexcept;
basic_address_iterator& operator++() noexcept;
basic_address_iterator operator++(int) noexcept;
basic_address_iterator& operator--() noexcept;
basic_address_iterator operator--(int) noexcept;
// other members as required by C++ 2014 [input.iterators]
private:
Address address_; // exposition only
};
} // namespace ip
} // inline namespace v1
} // namespace net
} // namespace experimental
} // namespace std
Specializations of basic_address_iterator satisfy the requirements for input iterators (C++ 2014 [input.iterators]).
basic_address_iterator(const Address& a) noexcept;
Effects: Initializes address_ with a.
reference operator*() const noexcept;
Returns: address_.
pointer operator->() const noexcept;
Returns: addressof(address_).
basic_address_iterator& operator++() noexcept;
Effects: Sets address_ to the next unique address in network byte order.
Returns: *this.
basic_address_iterator operator++(int) noexcept;
Effects: Sets address_ to the next unique address in network byte order.
Returns: The prior value of *this.
basic_address_iterator& operator--() noexcept;
Effects: Sets address_ to the prior unique address in network byte order.
Returns: *this.
basic_address_iterator operator--(int) noexcept;
Effects: Sets address_ to the prior unique address in network byte order.
Returns: The prior value of *this.