The year is 2019

Exil Exil at gmall.com
Sat Jul 27 18:50:16 UTC 2019


On Saturday, 27 July 2019 at 16:12:35 UTC, 12345swordy wrote:
> On Saturday, 27 July 2019 at 09:04:45 UTC, Mike Franklin wrote:
>
>> I would be perfectly happy with `opImiplicitCast` or some way 
>> to have implicit constructors.  But Walter has already voiced 
>> his disapproval of that (See the comments in 
>> https://github.com/dlang/dmd/pull/10161 for the 
>> disappointment), so our choices are getting slim.  I'm trying 
>> to find something he would be willing to approve. If you have 
>> any ideas, I'm all ears.
>>
>> Mike
>
> We shouldn't let Walter disapproval effect us. If we think it a 
> really good idea then we should pursuit it.
>
> Walter thinks the opImplicitCast that we are proposing will be 
> the same thing as C++. It isn't. C++ genius "idea" is to have 
> implicit conversions opt-out rather then opt-in.
>
> -Alex

I don't agree. C++ strings are a good source of how it can be 
misused. I'm glad QString doesn't have implicit conversion with 
std::string. I remember reading a comment on a 
QString::fromStdString() call that was something along the lines 
of, "shitty QString doesn't support implicit conversion to 
std::string". I can only imagine how difficult it would be to 
track down all the implicit conversions to and from QString if it 
was an implicit conversion. And for whoever wrote that comment 
cause they didn't want to write a few extra characters. 
Ultimately it doesn't add functionality, it just reduces the 
amount of code you have to write by a small amount in some places 
and ultimately it makes your code less readable because of the 
hidden conversions. I don't think it's worth the price to pay.


More information about the Digitalmars-d mailing list