Loading...
Searching...
No Matches
TfOverloads< Ts > Struct Template Reference

A utility to combine multiple callable objects into a single overloaded callable object. More...

#include <stl.h>

Inherits Ts.

Detailed Description

template<class... Ts>
struct TfOverloads< Ts >

A utility to combine multiple callable objects into a single overloaded callable object.

This is convenient to create "visitors" for things like std::variant and other types. It's often used with lambdas but its use is not restricted to lambdas. Example usage:

std::variant<int, std::string> var { 123 };
std::visit(TfOverloads {
[](int ival) { /* handle int */ },
[](std::string const &) { /* handle string */ }
}, var);
A utility to combine multiple callable objects into a single overloaded callable object.
Definition: stl.h:383

Definition at line 383 of file stl.h.


The documentation for this struct was generated from the following file: