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

fix: add missing operators #1620

Merged
merged 1 commit into from
Feb 3, 2025
Merged

fix: add missing operators #1620

merged 1 commit into from
Feb 3, 2025

Conversation

killcerr
Copy link
Contributor

@killcerr killcerr commented Feb 2, 2025

What does this PR do?

Add missing operators

Which issues does this PR resolve?

Checklist before merging

Thank you for your contribution to the repository.
Before submitting this PR, please make sure:

  • Your code builds clean without any errors or warnings
  • Your code follows the code style of this repository (see the wiki)
  • You have tested all functions
  • You have not used code without license
  • You have added statement for third-party code

@OEOTYAN
Copy link
Member

OEOTYAN commented Feb 2, 2025

啥玩意

@OEOTYAN
Copy link
Member

OEOTYAN commented Feb 2, 2025

这种东西要跟其他类型比较不应该显式写出来么

@OEOTYAN
Copy link
Member

OEOTYAN commented Feb 2, 2025

而且跟其他类型比较本身两边不等价 不应该说成员 不然A==B合法B==A用不了

@killcerr
Copy link
Contributor Author

killcerr commented Feb 3, 2025

而且跟其他类型比较本身两边不等价 不应该说成员 不然A==B合法B==A用不了

c++20修改了吧?

struct A
{
        bool operator==(int) const
        {
                return true;
        }
};
int main()
{
        A a;
        a==1;
        1==a;
}

c++20标准下,是可以通过编译的

@killcerr
Copy link
Contributor Author

killcerr commented Feb 3, 2025

这种东西要跟其他类型比较不应该显式写出来么

mc里面很多地方一会用数字一会用AutomaticID的,如果改成显式的会比较麻烦

@OEOTYAN OEOTYAN merged commit 1781258 into LiteLDev:main Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants