Constructor

Synopsis

Declared in header </boost/url/static_url.hpp#L217[boost/url/static_url.hpp,window=blank_]>

static_url(string_view s);

Description

This function constructs a url from the string s, which must contain a valid URI or relative-ref or else an exception is thrown. The new url retains ownership by making a copy of the passed string.

Example

static_url< 1024 > u( "https://www.example.com" );

Effects

return static_url( parse_uri_reference( s ).value() );

Postconditions

this->buffer().data() != s.data()

Complexity

Linear in s.size().

Exception Safety

Exceptions thrown on invalid input.

BNF

URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

relative-ref  = relative-part [ "?" query ] [ "#" fragment ]

Specification

Return Value

  • void

Parameters

Name Type

s

string_view