![]() |
Home | Libraries | People | FAQ | More |
Set the port.
static_url& set_port_number( std::uint16_t n);
The port is set to the specified integer.
assert( url( "http://www.example.com" ).[link url.ref.boost__urls__static_url.set_port_number `set_port_number`]( 8080 ).[link url.ref.boost__urls__static_url.authority `authority`]().[link url.ref.boost__urls__static_url.buffer `buffer`]() == "www.example.com:8080" );
this->[link url.ref.boost__urls__static_url.has_authority `has_authority`]() == true && this->[link url.ref.boost__urls__static_url.has_port `has_port`]() == true && this->[link url.ref.boost__urls__static_url.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__static_url.authority `authority`] = [ [link url.ref.boost__urls__static_url.userinfo `userinfo`] "@" ] [link url.ref.boost__urls__static_url.host `host`] [ ":" [link url.ref.boost__urls__static_url.port `port`] ] [link url.ref.boost__urls__static_url.port `port`] = *DIGIT
remove_port
, /root/project/libs/url/include/boost/url/static_url.hpp