Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the master branch, built from commit 41715b1c50.
PrevUpHomeNext
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( url_view( "http://localhost.com:8080" ).port_number() == 8080 );
Complexity

Constant.

Exception Safety

Throws nothing.

BNF
port        = *DIGIT
Specification
See Also

encoded_host_and_port, has_port, port.


PrevUpHomeNext