chapel
chapel copied to clipboard
[Feature Request]: Support default initialization for heaps
Summary of Feature
Description:
I think you have to create a heap using new
or the createHeap
functions today. It would be nice to support something like var h: heap(eltType);
(which doesn't work because the comparator
field is generic) or var h: heap(eltType, parSafe, comparatorType);
if you're trying to be very explicit.
Note that trying to write the former causes an error message that references the _lock
field, which is not documented and so would probably be the first time a user is hearing about it (and not something we want to encourage users to rely on, since we'll want to support private fields at some point).
Is this a blocking issue with no known work-arounds? I don't think so, but I didn't encounter this while trying to write real code.
Code Sample
use Heap;
var h: heap(eltType);
var h2: heap(eltType, parSafe, comparatorType);