mirror of
https://github.com/boostorg/optional.git
synced 2025-07-29 12:07:21 +02:00
Correct definition of operator unspecified-bool-type. Make reference for is_initialized point to this operator. Fixes #6364.
[SVN r82911]
This commit is contained in:
@ -660,7 +660,7 @@ __SPACE__
|
|||||||
[: `optional<T>::operator `['unspecified-bool-type]`() const ;`]
|
[: `optional<T>::operator `['unspecified-bool-type]`() const ;`]
|
||||||
|
|
||||||
* [*Returns:] An unspecified value which if used on a boolean context
|
* [*Returns:] An unspecified value which if used on a boolean context
|
||||||
is equivalent to (`get() != 0`)
|
is equivalent to (`get_ptr() != 0`)
|
||||||
* [*Throws:] Nothing.
|
* [*Throws:] Nothing.
|
||||||
* [*Example:]
|
* [*Example:]
|
||||||
``
|
``
|
||||||
@ -697,15 +697,7 @@ __SPACE__
|
|||||||
|
|
||||||
[: `bool optional<T>::is_initialized() const ;`]
|
[: `bool optional<T>::is_initialized() const ;`]
|
||||||
|
|
||||||
* [*Returns: ] `true` if the `optional` is initialized, `false` otherwise.
|
* [*Deprecated:] Same as `operator `['unspecified-bool-type]`() ;`
|
||||||
* [*Throws:] Nothing.
|
|
||||||
* [*Example:]
|
|
||||||
``
|
|
||||||
optional<T> def ;
|
|
||||||
assert ( !def.is_initialized() );
|
|
||||||
optional<T> opt ( v ) ;
|
|
||||||
assert ( opt.is_initialized() );
|
|
||||||
``
|
|
||||||
|
|
||||||
__SPACE__
|
__SPACE__
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user