Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
url_base::port

(Inherited from url_view_base)

Return the port.

Synopsis
core::string_view
port() const;
Description

If present, this function returns a string representing the port (which may be empty). Otherwise it returns an empty string.

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

Constant.

Exception Safety

Throws nothing.

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

encoded_host_and_port, has_port, port_number.


PrevUpHomeNext