Return the host as an IPv6 address.
urls::ipv6_address ipv6_address() const;
If host_type
equals urls::host_type::ipv6
, this function returns the
corresponding ipv6_address
of the host if it
exists, otherwise it returns the unspecified address which is equal to
"0:0:0:0:0:0:0:0".
url_view u( "ftp://[::1]" ); ipv6_address ip = u.ipv6_address(); assert( ip.is_loopback() );
IPv6address = 6( h16 ":" ) ls32 / "::" 5( h16 ":" ) ls32 / [ h16 ] "::" 4( h16 ":" ) ls32 / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 / [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 / [ *4( h16 ":" ) h16 ] "::" ls32 / [ *5( h16 ":" ) h16 ] "::" h16 / [ *6( h16 ":" ) h16 ] "::" ls32 = ( h16 ":" h16 ) / IPv4address ; least-significant 32 bits of address h16 = 1*4HEXDIG ; 16 bits of address represented in hexadecimal
Throws nothing.
encoded_hostname
, hostname
, host_type
, ipv4_address
, ipvfuture
, urls::ipv6_address
.