DIP19: Remove comma operator from D and provision better syntactic support for tuples

deadalnix deadalnix at gmail.com
Mon Sep 24 06:05:41 PDT 2012


Le 24/09/2012 14:15, Jacob Carlborg a écrit :
> On 2012-09-24 12:06, Nick Sabalausky wrote:
>
>> No, because there's nothing typed (int) involved there. But you could do
>> this:
>>
>> int a = 3;
>> (int) b = a;
>> a = b;
>
> But you said:
>
> "They would just be implicitly convertible
> to non-tuple form *if* needed, and vice versa."
>
> To me that sounds like a tuple of one element of the type int would be
> implicitly convertible to an int. And, an int would be implicitly
> convertible to a tuple of one element.
>

I understand your example, but in it, no (int) are involved. So no 
conversion have to be done (and you get an error).

You see in example above that conversion is done when int is given where 
(int) is expected or vice versa, not whenever the compiler feels to.


More information about the Digitalmars-d mailing list