boost::urls::authority_view::has_port :: Boost Libraries Documentation

# boost::urls::authority_view::has_port

Return true if a port is present

## Synopsis

Declared in `<boost/url/authority_view.hpp>`

    constexpr
    bool
    has_port() const noexcept;

## Description

This function returns true if an authority is present and contains a port.

## Example

    assert( url_view( "wss://www.example.com:443" ).has_port() );

## Complexity

Constant.

## Exception Safety

Throws nothing.

## BNF

    authority   = [ userinfo "@" ] host [ ":" port ]

    port        = *DIGIT

## Specification

- 3.2.3. Port (rfc3986)

## Return Value

`true` if a port is present, otherwise `false`

## See Also

`encoded_host_and_port`, `port`, `port_number`.

Created with MrDocs