folly::variant_match

variant_match overloads

Synopses

Declared in <folly/Overload.h>

Match Variant with one of the Cases

template<
    typename Variant,
    typename... Cases>
decltype(auto)
variant_match(
    Variant&& variant,
    Cases&&... cases);
» more...

Match Variant with one of the Cases, returning a fixed result type R.

template<
    typename R,
    typename Variant,
    typename... Cases>
R
variant_match(
    Variant&& variant,
    Cases&&... cases);
» more...

Return Value

  • The result of invoking the matching case.
  • The result of invoking the matching case, as type R.

Parameters

NameDescription
variantThe variant to match against.
casesThe cases to match the variant with.