![]() |
Home | Libraries | People | FAQ | More |
Set the port.
url_base& set_port_number( std::uint16_t n);
The port is set to the specified integer.
assert( [link url.ref.boost__urls__url_base.url `url`]( "http://www.example.com" ).[link url.ref.boost__urls__url_base.set_port_number `set_port_number`]( 8080 ).[link url.ref.boost__urls__url_base.authority `authority`]().[link url.ref.boost__urls__url_base.buffer `buffer`]() == "www.example.com:8080" );
this->[link url.ref.boost__urls__url_base.has_authority `has_authority`]() == true && this->[link url.ref.boost__urls__url_base.has_port `has_port`]() == true && this->[link url.ref.boost__urls__url_base.port_number `port_number`]() == n
Linear in this->size()
.
Strong guarantee. Calls to allocate may throw.
Name |
Description |
---|---|
|
The port number to set. |
[link url.ref.boost__urls__url_base.authority `authority`] = [ [link url.ref.boost__urls__url_base.userinfo `userinfo`] "@" ] [link url.ref.boost__urls__url_base.host `host`] [ ":" [link url.ref.boost__urls__url_base.port `port`] ] [link url.ref.boost__urls__url_base.port `port`] = *DIGIT