mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-10 23:44:29 +00:00
remove throw from enum_fuse
This commit is contained in:
parent
9bfb90760a
commit
756b139368
2 changed files with 12 additions and 14 deletions
|
|
@ -1015,10 +1015,10 @@ TEST_CASE("constexpr_for") {
|
|||
}
|
||||
|
||||
static int switch_case_2d(Color color, Directions direction) {
|
||||
switch (magic_enum::enum_fuse(color, direction)) {
|
||||
case magic_enum::enum_fuse(Color::RED, Directions::Up):
|
||||
switch (magic_enum::enum_fuse(color, direction).value()) {
|
||||
case magic_enum::enum_fuse(Color::RED, Directions::Up).value():
|
||||
return 1;
|
||||
case magic_enum::enum_fuse(Color::BLUE, Directions::Down):
|
||||
case magic_enum::enum_fuse(Color::BLUE, Directions::Down).value():
|
||||
return 2;
|
||||
default:
|
||||
return 0;
|
||||
|
|
@ -1028,11 +1028,11 @@ static int switch_case_2d(Color color, Directions direction) {
|
|||
enum class Index { zero = 0, one = 1, two = 2 };
|
||||
|
||||
static int switch_case_3d(Color color, Directions direction, Index index) {
|
||||
switch (magic_enum::enum_fuse(color, direction, index)) {
|
||||
case magic_enum::enum_fuse(Color::RED, Directions::Up, Index::zero):
|
||||
switch (magic_enum::enum_fuse(color, direction, index).value()) {
|
||||
case magic_enum::enum_fuse(Color::RED, Directions::Up, Index::zero).value():
|
||||
return 1;
|
||||
// model accidental removal of last index, must not match anything
|
||||
case magic_enum::enum_fuse(Color::BLUE, Directions::Up):
|
||||
case magic_enum::enum_fuse(Color::BLUE, Directions::Up).value():
|
||||
return 2;
|
||||
default:
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue