:relfileprefix: ../../../ [#E1071D79A664F9A75CAD7E35E01B2BE779CF20BE] = Function segments_encoded_ref::assign pass:v,q[Assign segments] == Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void assign(initializer_list init); ---- == Description pass:v,q[The existing contents are replaced] pass:v,q[by a copy of the contents of the] pass:v,q[initializer list.] pass:v,q[Reserved characters in the list are] pass:v,q[automatically escaped.] pass:v,q[Escapes in the list are preserved.] pass:v,q[All iterators are invalidated.] [NOTE] pass:v,q[None of the character buffers referenced] pass:v,q[by the list may overlap the character] pass:v,q[buffer of the underlying url, or else] pass:v,q[the behavior is undefined.] === Example [,cpp] ---- url u; u.segments().assign( {"path", "to", "file.txt"} ); ---- === Complexity pass:v,q[Linear in `init.size() + this->url().encoded_query().size() + this->url().encoded_fragment().size()`.] === Exception Safety pass:v,q[Strong guarantee.] pass:v,q[Calls to allocate may throw.] pass:v,q[Exceptions thrown on invalid input.] == Return Value * `void` == Parameters |=== | Name | Type | *init* | `initializer_list` |===