DMD 0.166 release

Derek Parnell derek at nomail.afraid.org
Thu Aug 31 20:18:09 PDT 2006


On Fri, 01 Sep 2006 04:08:28 +0100, Tom S wrote:

> Derek Parnell wrote:
>> On Fri, 01 Sep 2006 00:50:48 +0200, Oskar Linde wrote:
>> 
>>> Jarrett Billingsley wrote:
>>>
>>>> "Kirk McDonald" <kirklin.mcdonald at gmail.com> wrote in message
>>>> news:ed7ddg$6r2$1 at digitaldaemon.com...
>>>>
>>>>> Nice. I'll have to play with the improved IFTI support.
>>>>>
>>>> Hm.  I missed this new feature.  What does it include?  There's not even a
>>>> link to a conversation, and I don't remember any threads about this.
>>> It is really just a small patch that enables implicit function template
>>> instantiation for member function and operator templates. It should work
>>> identically to how IFTI works for free functions. 
>>>
>>> It should open up quite a few door. Here is a quick demo I hacked together
>>> of how compile time dimensionality checking can be implemented:
>>>
>>> http://www.csc.kth.se/~ol/physical.d
>>>
>>> /Oskar
>> 
>> In your example code you have ...
>> 
>> 	// One wishes the .toString was unnecessary...
>> 	writefln("A current of ",i.toString);
>> 	writefln("through a voltage of ",v.toString);
>> 	writefln("requires a resistance of ",r.toString);
>> 	writefln("and produces ",w.toString," of heat.");
>> 	writefln("Total energy used in ",ti.toString," is ",e.toString);
>> 
>> but could you not also use ...
>> 
>> 	writefln("A current of %s",i);
>> 	writefln("through a voltage of %s",v);
>> 	writefln("requires a resistance of %s",r);
>> 	writefln("and produces %s of heat.",w);
>> 	writefln("Total energy used in %s is %s",ti,e);
> 
> Nope, since it only works for classes, and his SiQuantity is a struct

Damn! I didn't know that. What's the rationale for such a seemingly
arbitrary restriction?

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocrity!"
1/09/2006 1:17:19 PM



More information about the Digitalmars-d-announce mailing list