template<class... args_t>
struct qx::visit_overload< args_t >
This struct allows to visit std::variant with lambdas
- Note
- https://www.cppstories.com/2018/09/visit-variants/
- Template Parameters
-
struct Fluid { };
struct LightItem { };
struct HeavyItem { };
struct FragileItem { };
int main() {
std::variant<Fluid, LightItem, HeavyItem, FragileItem> package;
{
[](const Fluid& ) { std::cout << "fluid\n"; },
[](const LightItem& ) { std::cout << "light item\n"; },
[](const auto&) { std::cout << "default\n"; }
},
package);
}
Definition at line 134 of file type_traits.h.