-
Notifications
You must be signed in to change notification settings - Fork 10
Combine the lambda of visitor #4
Copy link
Copy link
Open
Description
Hi,
Would you mine adding a make_visitor as seen on this page to allow using lambada with multiple type handling ?
Ref: https://bitbashing.io/std-visit.html
Ex :
[](auto& arg) {
using T = std::decay_t<decltype(arg)>;
if constexpr (std::is_same_v<T, string>) {
printf("string: %s\n", arg.c_str());
// ...
}
else if constexpr (std::is_same_v<T, int>) {
printf("integer: %d\n", arg);
// ...
}
else if constexpr (std::is_same_v<T, bool>) {
printf("bool: %d\n", arg);
// ...
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels