On 05/16/12 23:46, H. S. Teoh wrote: > On Wed, May 16, 2012 at 11:34:18PM +0200, Timon Gehr wrote: >> On 05/16/2012 11:09 PM, H. S. Teoh wrote: >>> >>> OK, this isn't the same as your nothrow wrapper, but the principle is >>> the same. The funcWrap template can basically call _any_ function >>> that returns _anything_. >>> >>> D just acquired whole new levels of cool for me. :-) >>> >> >> There are still some restrictions to be sorted out though. For >> example, try it with funcWrap(&printShort,1); > > Yes I noticed that compiler type inference didn't work in that case. > This is one area I really hope will be improved soon. I kept running > into this in the new AA implementation: assigning [1,2,3] to ubyte[] > works, but passing [1,2,3] to a template automatically forces it into > int[] even though the template body then tries to assign it to a > ubyte[], causing an error.
http://d.puremagic.com/issues/show_bug.cgi?id=4953 I don't have dmd here, hence can't check, but it seems there's a chance it's already fixed. artur
