mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-16 00:34:19 +00:00
replace C-style cast with static_cast
This commit is contained in:
parent
94b133abd8
commit
1e6c9a5a5a
1 changed files with 1 additions and 1 deletions
|
|
@ -86,7 +86,7 @@ TEST_CASE("enum_cast") {
|
|||
constexpr auto cr = enum_cast<Color>(-12);
|
||||
REQUIRE(cr.value() == Color::RED);
|
||||
REQUIRE(enum_cast<Color&>(7).value() == Color::GREEN);
|
||||
REQUIRE(enum_cast<Color>((int)cm[2]).value() == Color::BLUE);
|
||||
REQUIRE(enum_cast<Color>(static_cast<int>(cm[2])).value() == Color::BLUE);
|
||||
REQUIRE_FALSE(enum_cast<Color>(0).has_value());
|
||||
|
||||
constexpr auto no = enum_cast<Numbers>(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue