value::as_bool
Return the underlying bool, or throw an exception.
Synopsis
bool&
as_bool(
boost::source_location const& loc = BOOST_CURRENT_LOCATION); (1)
bool
as_bool(
boost::source_location const& loc = BOOST_CURRENT_LOCATION) const; (2)
Description
If is_bool() is true, returns a reference to (1) or a copy of (2) the underlying bool, otherwise throws an exception.
Exception Safety
Strong guarantee.
Parameters
| Name | Description |
|---|---|
|
|
Exceptions
| Type | Thrown On |
|---|---|
|
|
Complexity
Constant.