21 Internet protocol [internet]

21.14 Class template ip::basic_resolver_entry [internet.resolver.entry]

An object of type basic_resolver_entry<InternetProtocol> represents a single element in the results returned by a name resolution operation.

namespace std {
namespace experimental {
namespace net {
inline namespace v1 {
namespace ip {

  template<class InternetProtocol>
  class basic_resolver_entry
  {
  public:
    // types:
    using protocol_type = InternetProtocol;
    using endpoint_type = typename InternetProtocol::endpoint;

    // [internet.resolver.entry.cons], constructors:
    basic_resolver_entry();
    basic_resolver_entry(const endpoint_type& ep,
                         string_view h,
                         string_view s);

    // [internet.resolver.entry.members], members:
    endpoint_type endpoint() const;
    operator endpoint_type() const;
    template<class Allocator = allocator<char>>
      basic_string<char, char_traits<char>, Allocator>
        host_name(const Allocator& a = Allocator()) const;
    template<class Allocator = allocator<char>>
      basic_string<char, char_traits<char>, Allocator>
        service_name(const Allocator& a = Allocator()) const;
  };

  // [internet.resolver.entry.comparisons], basic_resolver_entry comparisons:
  template<class InternetProtocol>
    bool operator==(const basic_resolver_entry<InternetProtocol>& a,
                    const basic_resolver_entry<InternetProtocol>& b);
  template<class InternetProtocol>
    bool operator!=(const basic_resolver_entry<InternetProtocol>& a,
                    const basic_resolver_entry<InternetProtocol>& b);

} // namespace ip
} // inline namespace v1
} // namespace net
} // namespace experimental
} // namespace std

21.14.1 ip::basic_resolver_entry constructors [internet.resolver.entry.cons]

basic_resolver_entry();

Effects: Equivalent to basic_resolver_entry<InternetProtocol>(endpoint_type(), "", "").

basic_resolver_entry(const endpoint_type& ep, string_view h, string_view s);

Postconditions:

21.14.2 ip::basic_resolver_entry members [internet.resolver.entry.members]

endpoint_type endpoint() const;

Returns: The endpoint associated with the resolver entry.

operator endpoint_type() const;

Returns: endpoint().

template<class Allocator = allocator<char>> basic_string<char, char_traits<char>, Allocator> host_name(const Allocator& a = Allocator()) const;

Returns: The host name associated with the resolver entry.

Remarks: Ill-formed unless allocator_traits<Allocator>::value_type is char.

template<class Allocator = allocator<char>> basic_string<char, char_traits<char>, Allocator> service_name(const Allocator& a = Allocator()) const;

Returns: The service name associated with the resolver entry.

Remarks: Ill-formed unless allocator_traits<Allocator>::value_type is char.

21.14.3 op::basic_resolver_entry comparisons [internet.resolver.entry.comparisons]

template<class InternetProtocol> bool operator==(const basic_resolver_entry<InternetProtocol>& a, const basic_resolver_entry<InternetProtocol>& b);

Returns: a.endpoint() == b.endpoint() && a.host_name() == b.host_name() && a.service_name() == b.service_name().

template<class InternetProtocol> bool operator!=(const basic_resolver_entry<InternetProtocol>& a, const basic_resolver_entry<InternetProtocol>& b);

Returns: !(a == b).