D vs C++

Max Samukha spambox at d-coding.com
Tue Dec 28 03:49:54 PST 2010


On 12/27/2010 07:09 PM, Andrei Alexandrescu wrote:
> On 12/27/10 2:19 AM, Gour wrote:
>> On Sun, 26 Dec 2010 14:33:25 -0600
>>>>>>>> "Seth" == Seth Hoenig<seth.a.hoenig at gmail.com> wrote:
>>
>> Seth> This is certainly a personal preference, but I would add static
>> Seth> typing to that list.
>>
>> +1
>
> Conversely, I wonder how we can improve the dynamic typing capabilities
> of D. For example, I'd be very interested in hearing experience with
> using Variant almost exclusively as the type of choice.
>
> Andrei

I have had some experience with Qt's analogue of Variant - QVariant. 
Variant looks superior to QVariant in almost all respects. Where it is 
lacking is implicit conversions from static types:

void foo(Variant v);
foo(1);

Quite a nuisance if one wants to use Variant exclusively.

Another QVariant feature I would like to see in Variant is a constructor 
taking the type descriptor and a void pointer to the value. For example, 
it is needed for constructing Variants from variadic arguments.



More information about the Digitalmars-d mailing list