What did you think about an implicitConversionOp ?
sighoya
sighoya at gmail.com
Sun Dec 27 13:01:54 UTC 2020
On Sunday, 27 December 2020 at 09:27:05 UTC, Walter Bright wrote:
> It's like burying your dead cat in Pet Sematary. Sure, it's
> cool when it comes back to life, but you'll be
> sssss-ooooo-rrrrr-eeeee !
Hmm, I wasn't aware that Walter is also a poet :).
> I'm speaking here from C++'s experience.
When talking about the merits of certain features and at the same
time referring to their use in C++ inevitably biases the balance
of pro and cons to the contra site.
The point is, however, could we do it better than C++?
Regarding templates, we already did.
> 1. implicit declaration of variables
Did you the mention `auto` in conjunction with implicit
conversion?
> 2. macros
What has implicit conversion to do with macros, did you mean
templates?
As a counterargument, we already have classes and interfaces
leading to the same characteristics regarding template overload
resolution.
> 3. operator overloading for non-arithmetic purposes
> 4. implicit conversion operator overloads
Well I admit the evolving problem of ambiguity of implicit
conversions in overload resolution.
But what is harder for operator overloading than for normal
method overloading?
Overusing operators for nonsensical operations is already a code
smell.
More information about the Digitalmars-d
mailing list