Antipattern in core.memory.GC.addRange?

Steven Schveighoffer schveiguy at yahoo.com
Sat Sep 23 15:54:58 UTC 2017


On 9/23/17 1:55 AM, Petar Kirov [ZombineDev] wrote:

> 
> How about adding a template wrapper function, along the lines of:
> static void addRange(T)(const T[] arr)
> {
>      addRange(arr.ptr, T.sizeof * arr.length, typeid(T));
> }
> 
> 
> To core.memory.GC?

It sounds good. But will it be accepted?

Note, the true implementation should use integer overflow to reject 
invalid arrays.

-Steve


More information about the Digitalmars-d mailing list