[#boost-urls-arg] = xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::arg :relfileprefix: ../../ :mrdocs: Designate a named argument for a replacement field == Synopsis Declared in `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/format.hpp#L447[boost/url/format.hpp]>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class T> xref:boost/urls/named_arg.adoc[named_arg]<T> arg( core::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 The function should be used to designate a named argument for a replacement field in a format URL string. [,cpp] ---- assert(format("user/{id}", arg("id", 1)).buffer() == "user/1"); ---- == Return Value A temporary object with reference semantics for a named argument == Parameters |=== | Name | Description | *name* | The format argument name | *arg* | The format argument value |=== == See Also xref:boost/urls/format-02.adoc[format], xref:boost/urls/format_to-0b.adoc[format_to]. [.small]#Created with https://www.mrdocs.com[MrDocs]#