[#bsl-list-054-assign-06]
= xref:bsl.adoc[bsl]::xref:bsl/list-054.adoc[list]::assign
:relfileprefix: ../../
:mrdocs:

Replace the contents of this list with `numElements` copies of `value`&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;list&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
assign(
    xref:bsl/list-054/size_type.adoc[size&lowbar;type] numElements,
    xref:bsl/list-054/value_type.adoc[value&lowbar;type] const& value);
----

== Description

Note that, to the extent possible, existing elements of this list are copy&hyphen;assigned to, to minimize the number of nodes that need to be copy&hyphen;inserted or erased&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *numElements*
| number of copies of `value` to assign
| *value*
| value copied into each element
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
