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:
parent
cbbb6dd8f1
commit
3f0aad9f74
2 changed files with 2 additions and 1 deletions
|
|
@ -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());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue