@nogc hash

Marco Leise via Digitalmars-d digitalmars-d at puremagic.com
Fri Sep 9 04:16:19 PDT 2016


Am Fri, 09 Sep 2016 10:52:54 +0000
schrieb Guillaume Piolat <first.last at gmail.com>:

> On Friday, 9 September 2016 at 10:16:09 UTC, Marco Leise wrote:
> > it is - AFAICT - not possible to insert an
> > element into a hash table in @nogc code.  
> 
> It is with http://code.dlang.org/packages/emsi_containers

It does not /allocate/ with the GC, but the methods are
not /annotated/ @nogc, e.g. insert():
https://github.com/economicmodeling/containers/blob/master/src/containers/hashmap.d#L338
It's plain simple not possible out of the box* at the moment.

* writing your own hash function that covers every type is NOT
  "out of the box" :p

-- 
Marco



More information about the Digitalmars-d mailing list