1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-10 23:44:29 +00:00

Fix regression of enum_cast<>() when used with refs (EnumT& vs EnumT) (#16)

This commit is contained in:
Alexander Karatarakis 2019-10-03 00:02:39 -07:00 committed by Daniil Goncharov
parent cbbb6dd8f1
commit 3f0aad9f74
2 changed files with 2 additions and 1 deletions

View file

@ -86,6 +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&>(7).value() == Color::GREEN);
REQUIRE(enum_cast<Color>((int)cm[2]).value() == Color::BLUE);
REQUIRE_FALSE(enum_cast<Color>(0).has_value());