1
0
Fork 0
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:
oficsu 2020-03-12 09:28:09 +03:00 committed by GitHub
parent 94b133abd8
commit 1e6c9a5a5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);