bsl::visit

visit overloads

Synopses

Declared in <bslstl_variant.h>

Return the result of invoking visitor with the active alternative of variant.

template<
    class t_VISITOR,
    class t_VARIANT>
bsl::invoke_result<t_VISITOR&&, decltype(get<0>(BloombergLP::bslstl::Variant_ImpUtil::
                    asVariant(std::forward<t_VARIANT>(variant))))>::type
visit(
    t_VISITOR&& visitor,
    t_VARIANT&& variant);
» more...

Return the result of invoking visitor with the active alternative of variant, converted to t_RET.

template<
    class t_RET,
    class t_VISITOR,
    class t_VARIANT>
t_RET
visit(
    t_VISITOR&& visitor,
    t_VARIANT&& variant);
» more...

Return Value

  • result of invoking visitor on the active alternative
  • result of invoking visitor, converted to t_RET

Parameters

NameDescription
visitorcallable to invoke on the active alternative
variantvariant whose active alternative is visited