boost::urls::url_view_base::host_type :: Boost Libraries Documentation

# boost::urls::url_view_base::host_type

Return the host type

## Synopsis

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

    urls::host_type
    host_type() const noexcept;

## Description

This function returns one of the following constants representing the type of host present.

- `host_type::ipv4`

- `host_type::ipv6`

- `host_type::ipvfuture`

- `host_type::name`

- `host_type::none`

When `has_authority` is false, the host type is `host_type::none`.

## Example

    assert( url_view( "https://192.168.0.1/local.htm" ).host_type() == host_type::ipv4 );

## Complexity

Constant.

## Exception Safety

Throws nothing.

## Specification

- 3.2.2. Host (rfc3986)

## Return Value

The type of host present.

Created with MrDocs