mirror of
https://github.com/boostorg/optional.git
synced 2025-07-16 05:42:07 +02:00
value_or() requires that U is convertible to T
Due to Vladimir Batov.
This commit is contained in:
@ -98,10 +98,11 @@
|
||||
</p>
|
||||
<p>
|
||||
Such a <span class="emphasis"><em>de facto</em></span> idiom for referring to optional objects
|
||||
can be formalized in the form of a concept: the <a href="../../../../../../utility/OptionalPointee.html" target="_top">OptionalPointee</a>
|
||||
concept. This concept captures the syntactic usage of operators <code class="computeroutput"><span class="special">*</span></code>, <code class="computeroutput"><span class="special">-></span></code>
|
||||
and contextual conversion to <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
to convey the notion of optionality.
|
||||
can be formalized in the form of a concept: the <a href="../../../../../../utility/OptionalPointee.html" target="_top"><code class="computeroutput"><span class="identifier">OptionalPointee</span></code></a> concept. This
|
||||
concept captures the syntactic usage of operators <code class="computeroutput"><span class="special">*</span></code>,
|
||||
<code class="computeroutput"><span class="special">-></span></code> and contextual conversion
|
||||
to <code class="computeroutput"><span class="keyword">bool</span></code> to convey the notion
|
||||
of optionality.
|
||||
</p>
|
||||
<p>
|
||||
However, pointers are good to <span class="underline">refer</span>
|
||||
@ -127,7 +128,7 @@
|
||||
this semantics, so are inappropriate for the initialization and transport
|
||||
of optional values, yet are quite convenient for handling the access to
|
||||
the possible undefined value because of the idiomatic aid present in the
|
||||
<a href="../../../../../../utility/OptionalPointee.html" target="_top">OptionalPointee</a>
|
||||
<a href="../../../../../../utility/OptionalPointee.html" target="_top"><code class="computeroutput"><span class="identifier">OptionalPointee</span></code></a>
|
||||
concept incarnated by pointers.
|
||||
</p>
|
||||
<h6>
|
||||
|
Reference in New Issue
Block a user