[#boost-urls-ipv6_address]
= xref:boost/urls/ipv6_address.adoc[boost::urls::ipv6&lowbar;address]
:relfileprefix: ../../
:mrdocs:

An IP version 6 style address&period;

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L62[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class ipv6&lowbar;address;
----

== Types

[cols=2]
|===
| Name
| Description
| xref:boost/urls/ipv6_address/bytes_type.adoc[`bytes&lowbar;type`] 
| The type used to represent an address as an array of bytes&period;
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| xref:boost/urls/ipv6_address/2constructor-09.adoc[`ipv6&lowbar;address`]         [.small]#[constructor]#
| Constructors
| xref:boost/urls/ipv6_address/operator_assign.adoc[`operator&equals;`] 
| Copy Assignment
| xref:boost/urls/ipv6_address/is_loopback.adoc[`is&lowbar;loopback`] 
| Return true if the address is a loopback address
| xref:boost/urls/ipv6_address/is_unspecified.adoc[`is&lowbar;unspecified`] 
| Return true if the address is unspecified
| xref:boost/urls/ipv6_address/is_v4_mapped.adoc[`is&lowbar;v4&lowbar;mapped`] 
| Return true if the address is a mapped IPv4 address
| xref:boost/urls/ipv6_address/to_buffer.adoc[`to&lowbar;buffer`] 
| Write a dotted decimal string representing the address to a buffer
| xref:boost/urls/ipv6_address/to_bytes.adoc[`to&lowbar;bytes`] 
| Return the address as bytes, in network byte order
| xref:boost/urls/ipv6_address/to_string.adoc[`to&lowbar;string`] 
| Return the address as a string&period;
|===

== Static Member Functions

[cols=2]
|===
| Name
| Description
| xref:boost/urls/ipv6_address/loopback.adoc[`loopback`] 
| Return an address object that represents the loopback address
|===

== Static Data Members

[cols=2]
|===
| Name
| Description
| xref:boost/urls/ipv6_address/max_str_len.adoc[`max&lowbar;str&lowbar;len`] 
| The number of characters in the longest possible IPv6 string&period;
|===

== Friends

[cols=2]
|===
| Name
| Description
| `xref:boost/urls/operator_lshift-0f6.adoc[boost::urls::operator&lt;&lt;]`
| Format the address to an output stream
| `xref:boost/urls/operator_not_eq-07.adoc[boost::urls::operator!&equals;]`
| Return true if two addresses are not equal
| `xref:boost/urls/operator_eq-0fd.adoc[boost::urls::operator&equals;&equals;]`
| Return true if two addresses are equal
| `xref:boost/urls/operator_lshift-0f6.adoc[boost::urls::operator&lt;&lt;]`
| Format the address to an output stream
| `xref:boost/urls/operator_not_eq-07.adoc[boost::urls::operator!&equals;]`
| Return true if two addresses are not equal
| `xref:boost/urls/operator_eq-0fd.adoc[boost::urls::operator&equals;&equals;]`
| Return true if two addresses are equal
|===

== Non-Member Functions

[cols=2]
|===
| Name
| Description
| xref:boost/urls/parse_ipv6_address.adoc[`parse&lowbar;ipv6&lowbar;address`]
| Parse a string containing an IPv6 address&period;
|===

== Description

Objects of this type are used to construct, parse, and manipulate IP version 6 addresses&period;

== BNF
[,cpp]
----
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
----
== Specification
* https://datatracker.ietf.org/doc/html/rfc4291[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== See Also

xref:boost/urls/ipv4_address.adoc[`ipv4&lowbar;address`], xref:boost/urls/parse_ipv6_address.adoc[`parse&lowbar;ipv6&lowbar;address`]&period;


[.small]#Created with https://www.mrdocs.com[MrDocs]#
