Add example for switch default call with void

This commit is contained in:
sha512sum 2024-07-15 17:47:19 +00:00
parent ce44168333
commit 25ec03f84b

View file

@ -27,4 +27,18 @@ auto main() -> int {
});
return response;
}() == 3);
static_assert([] {
int response{};
utempl::Switch(
utempl::Tuple{2, 1, 0},
utempl::Tuple{0, 1, 2},
3,
[&](int value) {
response = value + 1;
},
[&] {
response = 3;
});
return response;
}() == 3);
};