[#bsl-set-0d-operator_assign-06]
= xref:bsl.adoc[bsl]::xref:bsl/set-0d.adoc[set]::operator&equals;
:relfileprefix: ../../
:mrdocs:

Assignment operators

== Synopses

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

Assign to this object the value and comparator of the specified `rhs` object, propagate to this object the allocator of `rhs` if the `ALLOCATOR` type has trait `propagate&lowbar;on&lowbar;container&lowbar;copy&lowbar;assignment`, and return a reference providing modifiable access to this object&period; If an exception is thrown, `&ast;this` is left in a valid but unspecified state&period; This method requires that the (template parameter) type `KEY` be `copy&hyphen;assignable` and `copy&hyphen;insertable` into this set (see &lcub;Requirements on `KEY`&rcub;)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/set-0d.adoc[set&lt;KEY, COMPARATOR, ALLOCATOR&gt;]&
xref:bsl/set-0d/operator_assign-04.adoc[operator&equals;](xref:bsl/set-0d.adoc[set] const& rhs);
----

[.small]#xref:bsl/set-0d/operator_assign-04.adoc[_» more&period;&period;&period;_]#

Assign to this object the value and comparator of the specified `rhs` object, propagate to this object the allocator of `rhs` if the `ALLOCATOR` type has trait `propagate&lowbar;on&lowbar;container&lowbar;move&lowbar;assignment`, and return a reference providing modifiable access to this object&period; The contents of `rhs` are moved (in constant time) to this set if `get&lowbar;allocator() &equals;&equals; rhs&period;get&lowbar;allocator()` (after accounting for the aforementioned trait)&semi; otherwise, all elements in this set are either destroyed or move&hyphen;assigned to and each additional element in `rhs` is move&hyphen;inserted into this set&period; `rhs` is left in a valid but unspecified state, and if an exception is thrown, `&ast;this` is left in a valid but unspecified state&period; This method requires that the (template parameter) type `KEY` be `move&hyphen;assignable` and `move&hyphen;insertable` into this set (see &lcub;Requirements on `KEY`&rcub;)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/set-0d.adoc[set&lt;KEY, COMPARATOR, ALLOCATOR&gt;]&
xref:bsl/set-0d/operator_assign-02.adoc[operator&equals;](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;set&gt;] rhs) noexcept(&sol;&ast; see-below &ast;&sol;);
----

[.small]#xref:bsl/set-0d/operator_assign-02.adoc[_» more&period;&period;&period;_]#

Assign to this object the value resulting from first clearing this set and then inserting each `value&lowbar;type` object in the specified `values` initializer list, ignoring those keys having a value equivalent to that which appears earlier in the list&semi; return a reference providing modifiable access to this object&period; This method requires that the (template parameter) type `KEY` be `copy&hyphen;insertable` into this set (see &lcub;Requirements on `KEY`&rcub;)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/set-0d.adoc[set&lt;KEY, COMPARATOR, ALLOCATOR&gt;]&
xref:bsl/set-0d/operator_assign-0d.adoc[operator&equals;](std::initializer&lowbar;list&lt;KEY&gt; values);
----

[.small]#xref:bsl/set-0d/operator_assign-0d.adoc[_» more&period;&period;&period;_]#


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