port

Return the port

Synopsis

string_view
port() const noexcept;

Declared in file <include/boost/url/authority_view.hpp> on line 1133

Defined in file <src/authority_view.cpp> on line 303

Description

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

Example

assert( url_view( "http://localhost.com:8080" ).port() == "8080" );

Complexity

Constant.

Exception Safety

Throws nothing.

BNF

port        = *DIGIT

Specification