Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

operator==( error_code, error_code ) is suboptimal #106

Open
pdimov opened this issue Feb 28, 2023 · 1 comment
Open

operator==( error_code, error_code ) is suboptimal #106

pdimov opened this issue Feb 28, 2023 · 1 comment

Comments

@pdimov
Copy link
Member

pdimov commented Feb 28, 2023

There's room for improvement both when the RHS is unknown (https://godbolt.org/z/sK3G6j3e6) and when it's known (https://godbolt.org/z/6M9qd4dqa). (GCC does best here; Clang is even worse.)

Fixing this would probably require switching from interop_category to unknown_category (and retaining the original code value) as mentioned in #95. Also, the

        bool s1 = lhs.lc_flags_ == 1;
        bool s2 = rhs.lc_flags_ == 1;

logic should probably be changed to an explicit if tree.

@pdimov
Copy link
Member Author

pdimov commented Feb 28, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant