4 ms·
I admit I only skimmed the article, but it looks like the only implicit operators discussed are implicit conversions. There are plenty of implicit conversions
by _kst_ 3y ago
I admit I only skimmed the article, but it looks like the only implicit operators discussed are implicit conversions.
There are plenty of implicit conversions in most languages. The C# feature being discussed is the ability to define your own implicit conversions.
I was expecting something like the "x y" or "xy" mathematical notation that means "x*y" (or x×y if you prefer).
- hinkley 3y agoWhen things are cheap, I have some hope that they are actually healthy. When they are free, I know that there's a huge pile of externalities I can't even begin to imagine yet. Javascript gets itself (and us) into trouble all the time with implicit conversions.
- Guvante 3y agoC# uses the syntax `operator bool` to define conversion so sometimes they get called operator accidentally.
- _kst_ 3y agoYou mean it uses `operator bool` where `bool` is the target type of the conversion, yes? I have no problem with the idea that conversions are operators. My point is that the title suggests something far more general that what the body of the article actually discusses. If the title had said "Implicit Conversions" rather than "Implicit Operators", it would have been much clearer and I wouldn't have commented.