mirror of
https://github.com/boostorg/variant2.git
synced 2025-07-30 04:07:16 +02:00
@ -1103,6 +1103,10 @@ public:
|
|||||||
} // namespace boost</code></pre>
|
} // namespace boost</code></pre>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="paragraph">
|
||||||
|
<p>In the descriptions that follow, let <code>i</code> be in the range <code>[0, sizeof…​(T))</code>,
|
||||||
|
and <code>Ti</code> be the <code>i</code>-th type in <code>T…​</code>.</p>
|
||||||
|
</div>
|
||||||
<div class="sect4">
|
<div class="sect4">
|
||||||
<h5 id="ref_constructors">Constructors</h5>
|
<h5 id="ref_constructors">Constructors</h5>
|
||||||
<div class="listingblock">
|
<div class="listingblock">
|
||||||
@ -2129,6 +2133,11 @@ in <code>T…​</code>.</p>
|
|||||||
<p>If <code>v.index()</code> is <code>I</code>, returns a reference to the object stored in
|
<p>If <code>v.index()</code> is <code>I</code>, returns a reference to the object stored in
|
||||||
the variant. Otherwise, throws <code>bad_variant_access</code>.</p>
|
the variant. Otherwise, throws <code>bad_variant_access</code>.</p>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="hdlist1">Remarks: </dt>
|
||||||
|
<dd>
|
||||||
|
<p>These functions do not participate in overload resolution
|
||||||
|
unless <code>I</code> < <code>sizeof…​(T)</code>.</p>
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@ -2202,15 +2211,16 @@ Otherwise, throws <code>bad_variant_access</code>.</p>
|
|||||||
<p></p>
|
<p></p>
|
||||||
<div class="dlist">
|
<div class="dlist">
|
||||||
<dl>
|
<dl>
|
||||||
<dt class="hdlist1">Requires: </dt>
|
|
||||||
<dd>
|
|
||||||
<p><code>I < sizeof…​(U)</code>. Otherwise, the program is ill-formed.</p>
|
|
||||||
</dd>
|
|
||||||
<dt class="hdlist1">Effects: </dt>
|
<dt class="hdlist1">Effects: </dt>
|
||||||
<dd>
|
<dd>
|
||||||
<p>A pointer to the value stored in the variant, if
|
<p>A pointer to the value stored in the variant, if
|
||||||
<code>v != nullptr && v->index() == I</code>. Otherwise, <code>nullptr</code>.</p>
|
<code>v != nullptr && v->index() == I</code>. Otherwise, <code>nullptr</code>.</p>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="hdlist1">Remarks: </dt>
|
||||||
|
<dd>
|
||||||
|
<p>These functions do not participate in overload resolution
|
||||||
|
unless <code>I</code> < <code>sizeof…​(T)</code>.</p>
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@ -2268,7 +2278,7 @@ the zero-based index of <code>U</code> in <code>T…​</code>.</p>
|
|||||||
<dl>
|
<dl>
|
||||||
<dt class="hdlist1">Returns: </dt>
|
<dt class="hdlist1">Returns: </dt>
|
||||||
<dd>
|
<dd>
|
||||||
<p><code>v.index() == w.index && get<I>(v) == get<I>(w)</code>, where <code>I</code>
|
<p><code>v.index() == w.index() && get<I>(v) == get<I>(w)</code>, where <code>I</code>
|
||||||
is <code>v.index()</code>.</p>
|
is <code>v.index()</code>.</p>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
@ -2311,7 +2321,7 @@ is <code>v.index()</code>.</p>
|
|||||||
<dl>
|
<dl>
|
||||||
<dt class="hdlist1">Returns: </dt>
|
<dt class="hdlist1">Returns: </dt>
|
||||||
<dd>
|
<dd>
|
||||||
<p><code>v.index() < w.index || (v.index() == w.index && get<I>(v) < get<I>(w))</code>,
|
<p><code>v.index() < w.index() || (v.index() == w.index() && get<I>(v) < get<I>(w))</code>,
|
||||||
where <code>I</code> is <code>v.index()</code>.</p>
|
where <code>I</code> is <code>v.index()</code>.</p>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
@ -2354,7 +2364,7 @@ where <code>I</code> is <code>v.index()</code>.</p>
|
|||||||
<dl>
|
<dl>
|
||||||
<dt class="hdlist1">Returns: </dt>
|
<dt class="hdlist1">Returns: </dt>
|
||||||
<dd>
|
<dd>
|
||||||
<p><code>v.index() < w.index || (v.index() == w.index && get<I>(v) <= get<I>(w))</code>,
|
<p><code>v.index() < w.index() || (v.index() == w.index() && get<I>(v) <= get<I>(w))</code>,
|
||||||
where <code>I</code> is <code>v.index()</code>.</p>
|
where <code>I</code> is <code>v.index()</code>.</p>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
@ -2466,7 +2476,7 @@ the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Versi
|
|||||||
</div>
|
</div>
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
<div id="footer-text">
|
<div id="footer-text">
|
||||||
Last updated 2019-05-12 00:15:41 +0300
|
Last updated 2019-05-12 18:44:13 +0300
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<style>
|
<style>
|
||||||
|
@ -247,6 +247,9 @@ public:
|
|||||||
} // namespace boost
|
} // namespace boost
|
||||||
```
|
```
|
||||||
|
|
||||||
|
In the descriptions that follow, let `i` be in the range `[0, sizeof...(T))`,
|
||||||
|
and `Ti` be the `i`-th type in `T...`.
|
||||||
|
|
||||||
#### Constructors
|
#### Constructors
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -707,6 +710,8 @@ template<size_t I, class... T>
|
|||||||
+
|
+
|
||||||
Effects: :: If `v.index()` is `I`, returns a reference to the object stored in
|
Effects: :: If `v.index()` is `I`, returns a reference to the object stored in
|
||||||
the variant. Otherwise, throws `bad_variant_access`.
|
the variant. Otherwise, throws `bad_variant_access`.
|
||||||
|
Remarks: :: These functions do not participate in overload resolution
|
||||||
|
unless `I` < `sizeof...(T)`.
|
||||||
|
|
||||||
```
|
```
|
||||||
template<class U, class... T>
|
template<class U, class... T>
|
||||||
@ -747,9 +752,10 @@ template<size_t I, class... T>
|
|||||||
[none]
|
[none]
|
||||||
* {blank}
|
* {blank}
|
||||||
+
|
+
|
||||||
Requires: :: `I < sizeof...(U)`. Otherwise, the program is ill-formed.
|
|
||||||
Effects: :: A pointer to the value stored in the variant, if
|
Effects: :: A pointer to the value stored in the variant, if
|
||||||
`v != nullptr && v\->index() == I`. Otherwise, `nullptr`.
|
`v != nullptr && v\->index() == I`. Otherwise, `nullptr`.
|
||||||
|
Remarks: :: These functions do not participate in overload resolution
|
||||||
|
unless `I` < `sizeof...(T)`.
|
||||||
|
|
||||||
```
|
```
|
||||||
template<class U, class... T>
|
template<class U, class... T>
|
||||||
@ -778,7 +784,7 @@ template<class... T>
|
|||||||
[none]
|
[none]
|
||||||
* {blank}
|
* {blank}
|
||||||
+
|
+
|
||||||
Returns: :: `v.index() == w.index && get<I>(v) == get<I>(w)`, where `I`
|
Returns: :: `v.index() == w.index() && get<I>(v) == get<I>(w)`, where `I`
|
||||||
is `v.index()`.
|
is `v.index()`.
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -797,7 +803,7 @@ template<class... T>
|
|||||||
[none]
|
[none]
|
||||||
* {blank}
|
* {blank}
|
||||||
+
|
+
|
||||||
Returns: :: `v.index() < w.index || (v.index() == w.index && get<I>(v) < get<I>(w))`,
|
Returns: :: `v.index() < w.index() || (v.index() == w.index() && get<I>(v) < get<I>(w))`,
|
||||||
where `I` is `v.index()`.
|
where `I` is `v.index()`.
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -816,7 +822,7 @@ template<class... T>
|
|||||||
[none]
|
[none]
|
||||||
* {blank}
|
* {blank}
|
||||||
+
|
+
|
||||||
Returns: :: `v.index() < w.index || (v.index() == w.index && get<I>(v) \<= get<I>(w))`,
|
Returns: :: `v.index() < w.index() || (v.index() == w.index() && get<I>(v) \<= get<I>(w))`,
|
||||||
where `I` is `v.index()`.
|
where `I` is `v.index()`.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
Reference in New Issue
Block a user