| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
I have made a small change to the is function overload to work with various of enums. You can now compare values of two different types of enums and have a false as a return - it will compile in inspect like below: v := lexeme::hash;
std::cout << inspect v -> std::string {
is lexeme::hash = "original lexeme";
is lexeme2::hash = "fake lexeme2";
is _ = "don't know";
} << std::endl;and will match the proper alternative. Of course, it will also work for the lexeme2::hash value. |
Sorry, something went wrong.
|
I am closing it as it is also covered by #79 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
The current implementation does not have an overload for the is function to handle enums.
The below code compiles by cppfront but the result code fails to compile with the cpp1 compiler.
cppfront result
Unfortunately, there is no overload that can match using an enum value. This change provides additional overload that works with enums - it checks if the value is an enum type and if the compared value is the same type as the enum value provided.
Working prototype: https://godbolt.org/z/1c4o8qG6P
Close #73