SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
spark::lib::overloaded< Ts > Struct Template Reference

Helper structure to pass a list of lambdas to a function (like std::visit) More...

#include <Overloaded.h>

Inheritance diagram for spark::lib::overloaded< Ts >:

Detailed Description

template<typename... Ts>
struct spark::lib::overloaded< Ts >

Helper structure to pass a list of lambdas to a function (like std::visit)

Template Parameters
TsTypes of the lambdas

Example:

std::variant<int, float, std::string> var;
std::visit(overloaded{
[](int i) { std::print("int: {}\n", i); },
[](float f) { std::print("float: {}\n", f); },
[](auto&& arg) { std::print("other: {}\n", arg); }
}, var);
Helper structure to pass a list of lambdas to a function (like std::visit)
Definition Overloaded.h:22