folly::overload

Combine multiple Cases in one function object

Synopsis

Declared in <folly/Overload.h>

template<typename... Cases>
constexpr
decltype(auto)
overload(Cases&&... cases);

Description

Each element of Cases must be a class type with operator(), a pointer to a function, a pointer to a member function, or a pointer to member data. final types and pointers to volatile-qualified member functions are not supported. If the Case type is a pointer to member, the first argument must be a class type or reference to class type (pointer to class type is not supported).

Return Value

A function object dispatching to the matching case.

Parameters

NameDescription
casesThe case objects to combine into one overload set.