Skip to content

Instantly share code, notes, and snippets.

@vinniefalco
Created January 23, 2020 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinniefalco/8055ab496456777c35a4c28a41223a57 to your computer and use it in GitHub Desktop.
Save vinniefalco/8055ab496456777c35a4c28a41223a57 to your computer and use it in GitHub Desktop.
/** Set the port.
The port of the URL is set to the specified
which must have the <em>port</em> syntax:
@li If the string is empty, the port is
cleared including the leading colon (':'). If
the port was the last remaining portion of
the authority, then the entire authority is
removed including the leading double slash ('//').
Otherwise,
@li If the string is not empty then the port
is set to the given string, with a leading
colon added.
If the URL previously did not contain an
authority (@ref has_authority returns `false`),
then the authority is added including the
leading double slash ('//').
The string must meet the syntactic requirements
of <em>port</em> otherwise an exception is
thrown.
@par ABNF
@code
port = *DIGIT
@endcode
@par Exception Safety
Strong guarantee.
Calls to allocate may throw.
@param s The string to set.
*/
BOOST_URL_DECL
basic_value&
set_port(string_view s);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment