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

Guideline against unconventional overloads #2118

Open
Eisenwave opened this issue Aug 11, 2023 · 2 comments
Open

Guideline against unconventional overloads #2118

Eisenwave opened this issue Aug 11, 2023 · 2 comments

Comments

@Eisenwave
Copy link
Contributor

Should there be a guideline recommending against overloading operators that people almost never anticipate to be overloaded? This would include things like:

  • overloading the comma operator
  • overloading logical AND and logical OR

There is fairly strong consensus in the community that doing so is questionable at best, and afaik standard libraries aren't all comma-safe either.

@jwakely
Copy link
Contributor

jwakely commented Aug 11, 2023

I'd add the unary & to that list.

@cubbimew
Copy link
Member

For every reasonable expectation of operator overloading, there is boost.spirit

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

3 participants