[#boost-urls-ipv4_address-2constructor-08]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/ipv4_address.adoc[ipv4&lowbar;address]::ipv4&lowbar;address
:relfileprefix: ../../../
:mrdocs:


Construct from a string&period;

== Synopsis


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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
ipv4&lowbar;address(core::string&lowbar;view s);
----

== Description


This function constructs an address from        the string `s`, which must contain a valid        IPv4 address string or else an exception        is thrown&period;

[NOTE]
For a non&hyphen;throwing parse function,        use xref:boost/urls/parse_ipv4_address.adoc[parse&lowbar;ipv4&lowbar;address]&period;


=== Exception Safety

Exceptions thrown on invalid input&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The input failed to parse correctly&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to parse&period;


|===

== See Also


xref:boost/urls/parse_ipv4_address.adoc[parse&lowbar;ipv4&lowbar;address]&period;






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