Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Voxera115856yExcept the answer is incorrect as C# supports operator overloading, at least since 4 years or more.
https://docs.microsoft.com/en-us/... -
@Voxera read more carefully
The answer doesn't say that operator overloading isn't possible, only that overriding them isn't supported -
Voxera115856y@hashedram sure, just never could considered it with operators, never even heard of overriding them in any language.
I use override of virtual methods.
But when thinking operators I just got sidetracked to overloading ;)
Is there any language where overriding operators is possible? -
@Voxera Yea C++ can. Like say in a graphics library, you want to convert one class into another, like a point into a circle with the point as center..
You can override the = operator and do
Circle X = Point Y
Equal operator gets overridden a lot if you define your own class and want to convert some other class into it easily.
"Does river direction make waterflow go downwards?"
Originally I selected it just to copypaste the "does effect support cause?" formulation, but as I selected, it unrolled the answer, and... oh...
rant