mirror of
https://github.com/boostorg/optional.git
synced 2025-07-29 20:17:21 +02:00
Doc fixes
[SVN r29158]
This commit is contained in:
@ -1049,7 +1049,7 @@ assert ( optX != optZ ) ;
|
||||
<pre>bool operator > ( optional<T> const& x, optional<T> const& y );
|
||||
</pre>
|
||||
<blockquote>
|
||||
<p><b>Returns:</b> !( y < x );</p>
|
||||
<p><b>Returns:</b> ( y < x );</p>
|
||||
<p><b>Throws:</b> Nothing.</p>
|
||||
</blockquote>
|
||||
|
||||
@ -1428,10 +1428,10 @@ public:
|
||||
|
||||
<H2><A NAME="bool">A note about optional<bool></A></H2>
|
||||
<p><code>optional<bool></code> should be used with special caution and consideration.</p>
|
||||
<p>First, it is functionally similar to a tristate boolean (false,maybe,true) —such as <u>boost::tribool</u> (not yet formally in boost)—except that in a tristate boolean,
|
||||
<p>First, it is functionally similar to a tristate boolean (false,maybe,true) —such as <a href="http://www.boost.org/doc/html/tribool.html">boost::tribool</a>—except that in a tristate boolean,
|
||||
the <i>maybe</i> state <u>represents a valid value</u>, unlike the corresponding state
|
||||
of an uninitialized optional<bool>.<br>
|
||||
It should be carefully considered if an optional bool instead of a tribool is really needed</p>
|
||||
It should be carefully considered if an optional<bool> instead of a tribool is really needed</p>
|
||||
<p>Second, optional<> provides an implicit conversion to bool. This conversion
|
||||
refers to the initialization state and not to the contained value.<br>
|
||||
Using optional<bool> can lead to subtle errors due to the implicit bool conversion:</p>
|
||||
|
Reference in New Issue
Block a user