21 Internet protocol [internet]

21.13 Class template ip::basic_endpoint [internet.endpoint]

21.13.1 ip::basic_endpoint constructors [internet.endpoint.cons]

constexpr basic_endpoint() noexcept;

Postconditions: this->address() == ip::address() and port() == 0.

constexpr basic_endpoint(const protocol_type& proto, port_type port_num) noexcept;

Requires: proto == protocol_type::v4() || proto == protocol_type::v6().

Postconditions:

  • If proto == protocol_type::v6(), this->address() == ip::address_v6(); otherwise,
    this->address() == ip::address_v4().

  • port() == port_num.

constexpr basic_endpoint(const ip::address& addr, port_type port_num) noexcept;

Postconditions: this->address() == addr and port() == port_num.