Add example for switch default call with void
This commit is contained in:
parent
ce44168333
commit
25ec03f84b
1 changed files with 14 additions and 0 deletions
|
@ -27,4 +27,18 @@ auto main() -> int {
|
||||||
});
|
});
|
||||||
return response;
|
return response;
|
||||||
}() == 3);
|
}() == 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);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue