...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Invoke a function object with the contents of a value
.
Defined in header <boost/json/visit.hpp>
template<
class Visitor>
auto
visit(
Visitor&& v,
value
& jv);
Invokes v
as if by std::forward<Visitor>(v)( X )
,
where X
is
jv.get_array()
if jv.is_array()
,
or
jv.get_object()
if jv.is_object()
,
or
jv.get_string()
if jv.is_string()
,
or
jv.get_int64()
if jv.is_int64()
,
or
jv.get_uint64()
if jv.is_uint64()
,
or
jv.get_double()
if jv.is_double()
,
or
jv.get_bool()
if jv.is_bool()
,
or
std::nullptr_t
if jv.is_null()
.
The value returned by Visitor.
Name |
Description |
---|---|
|
The visitation function to invoke |
|
The value to visit. |
Convenience header <boost/json.hpp>