CppCoreGuidelines
CppCoreGuidelines copied to clipboard
Guideline against unconventional overloads
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.
I'd add the unary & to that list.
For every reasonable expectation of operator overloading, there is boost.spirit