visit

Invoke a function object with the contents of a value.

Synopsis

Defined in header <boost/json/visit.hpp>.

template<
    class Visitor>
see below #endif
visit(
    Visitor&& v,
    value& jv); (1)

template<
    class Visitor>
see below #endif
visit(
    Visitor&& v,
    value const& jv); (2)

template<
    class Visitor>
see below #endif
visit(
    Visitor&& v,
    value&& jv); (3)

Description

Invokes v as if by std::forward<Visitor>(v)( X ), where X is a const (2) or mutable (1) lvalue reference, or an rvalue reference (3) to the underlying stored value.

Return Value

The result of calling v.

Parameters

Name Description

v

The visitation function to invoke.

jv

The value to visit.

Convenience header <boost/json.hpp>