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