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 an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

arg

Designate a named argument for a replacement field.

Synopsis

Defined in header <boost/url/format.hpp>

template<
    class T>
implementation-defined
arg(
    string_view name,
    T const& arg);
Description

Construct a named argument for a format URL string that contains named replacement fields. The function parameters should be convertible to an implementation defined type able to store the name and a reference to any type potentially used as a format argument.

Example
assert(format("user/{id}", arg("id", 1)).buffer() == "user/1");
Return Value

An temporary object with reference semantics for a named argument

Parameters

Name

Description

name

The argument name

arg

The argument value

See Also

format, format_to.

Convenience header <boost/url.hpp>


PrevUpHomeNext