One way to deal with transient ranges & char[] buffers

Jakob Ovrum jakobovrum at gmail.com
Fri Aug 2 16:43:21 PDT 2013


On Friday, 2 August 2013 at 08:37:50 UTC, monarch_dodra wrote:
> On Friday, 2 August 2013 at 05:35:28 UTC, H. S. Teoh wrote:
>> 	void func(S)(S input) if (isSomeString!S) {
>> 		string x = to!string(input);
>> 		... // use at will
>> 	}
>
> +1. I saw this used recently, and I find it very clever.

It's really not. It takes the decision to make a GC-allocated 
copy away from the client code in return for some minor 
convenience.


More information about the Digitalmars-d mailing list