mirror of
https://github.com/boostorg/variant2.git
synced 2025-07-29 19:57:18 +02:00
Specify the exception safety of emplace in more detail
This commit is contained in:
@ -1367,7 +1367,23 @@ value as if using the expression <code>Ti(std::forward<A>(a)…​
|
||||
</dd>
|
||||
<dt class="hdlist1">Exception Safety: </dt>
|
||||
<dd>
|
||||
<p>Basic. On exception the value of the variant is valid but unspecified.</p>
|
||||
<p>On exception:</p>
|
||||
<div class="ulist">
|
||||
<ul>
|
||||
<li>
|
||||
<p>If the list of alternatives contains <code>monostate</code>, the contained value
|
||||
is either unchanged, or <code>monostate{}</code>;</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Otherwise, if the list of alternatives contains types for which
|
||||
<code>is_nothrow_default_constructible_v</code> is <code>true</code>, the contained value
|
||||
is either unchanged, or <code>Tj{}</code>, where <code>Tj</code> is the first such alternative;</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Otherwise, the contained value is unchanged.</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</dd>
|
||||
<dt class="hdlist1">Remarks: </dt>
|
||||
<dd>
|
||||
@ -1415,7 +1431,23 @@ value as if using the expression <code>Ti(il, std::forward<A>(a)…
|
||||
</dd>
|
||||
<dt class="hdlist1">Exception Safety: </dt>
|
||||
<dd>
|
||||
<p>Basic. On exception the value of the variant is valid but unspecified.</p>
|
||||
<p>On exception:</p>
|
||||
<div class="ulist">
|
||||
<ul>
|
||||
<li>
|
||||
<p>If the list of alternatives contains <code>monostate</code>, the contained value
|
||||
is either unchanged, or <code>monostate{}</code>;</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Otherwise, if the list of alternatives contains types for which
|
||||
<code>is_nothrow_default_constructible_v</code> is <code>true</code>, the contained value
|
||||
is either unchanged, or <code>Tj{}</code>, where <code>Tj</code> is the first such alternative;</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Otherwise, the contained value is unchanged.</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</dd>
|
||||
<dt class="hdlist1">Remarks: </dt>
|
||||
<dd>
|
||||
|
@ -504,8 +504,13 @@ Ensures: :: `index() == I`.
|
||||
Returns: :: A reference to the new contained value.
|
||||
Throws: ::
|
||||
Nothing unless the initialization of the new contained value throws.
|
||||
Exception Safety: ::
|
||||
Basic. On exception the value of the variant is valid but unspecified.
|
||||
Exception Safety: :: On exception:
|
||||
- If the list of alternatives contains `monostate`, the contained value
|
||||
is either unchanged, or `monostate{}`;
|
||||
- Otherwise, if the list of alternatives contains types for which
|
||||
`is_nothrow_default_constructible_v` is `true`, the contained value
|
||||
is either unchanged, or `Tj{}`, where `Tj` is the first such alternative;
|
||||
- Otherwise, the contained value is unchanged.
|
||||
Remarks: ::
|
||||
This function shall not participate in overload resolution unless
|
||||
`std::is_constructible_v<Ti, A...>` is `true`.
|
||||
@ -526,8 +531,13 @@ Ensures: :: `index() == I`.
|
||||
Returns: :: A reference to the new contained value.
|
||||
Throws: ::
|
||||
Nothing unless the initialization of the new contained value throws.
|
||||
Exception Safety: ::
|
||||
Basic. On exception the value of the variant is valid but unspecified.
|
||||
Exception Safety: :: On exception:
|
||||
- If the list of alternatives contains `monostate`, the contained value
|
||||
is either unchanged, or `monostate{}`;
|
||||
- Otherwise, if the list of alternatives contains types for which
|
||||
`is_nothrow_default_constructible_v` is `true`, the contained value
|
||||
is either unchanged, or `Tj{}`, where `Tj` is the first such alternative;
|
||||
- Otherwise, the contained value is unchanged.
|
||||
Remarks: ::
|
||||
This function shall not participate in overload resolution unless
|
||||
`std::is_constructible_v<Ti, std::initializer_list<V>&, A...>` is `true`.
|
||||
|
Reference in New Issue
Block a user