[Tidbit] making your D code more modular & unittestable

Nick Sabalausky (Abscissa) via Digitalmars-d digitalmars-d at puremagic.com
Thu Mar 9 12:54:23 PST 2017


On 03/08/2017 04:34 PM, H. S. Teoh via Digitalmars-d wrote:
> 	auto parseFile(Slice)(Slice input)
> 		if (isRandomAccessRange!Slice && hasSlicing!Slice &&
> 		    is(ElementType!Slice : ubyte))
> 	{
> 		... // use nice input[x .. y] syntax, yay!
> 		return result;
> 	}
>

Wishlist for D3: Some brilliant form of sugar for declaring a function 
that takes a range.



More information about the Digitalmars-d mailing list