Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
static_url_base::port_number

(Inherited from url_view_base)

Return the port.

Synopsis
std::uint16_t
port_number() const;
Description

If a port is present and the numerical value is representable, it is returned as an unsigned integer. Otherwise, the number zero is returned.

Example
assert( [link url.ref.boost__urls__url_view_base.url_view `url_view`]( "http://localhost.com:8080" ).[link url.ref.boost__urls__static_url_base.port_number `port_number`]() == 8080 );
Complexity

Constant.

Exception Safety

Throws nothing.

BNF
[link url.ref.boost__urls__static_url_base.port `port`]        = *DIGIT
Specification
See Also

encoded_host_and_port, has_port, port.


PrevUpHomeNext