Thread overview | |||||
---|---|---|---|---|---|
|
September 22, 2011 Why this simple binaryHeap program does not compile? | ||||
---|---|---|---|---|
| ||||
import std.container; class T { int i; } void main() { auto array = Array!(T); auto heap = BinaryHeap!(Array!(T), "a.i < b.i")(array); } After compiling: dmd2/linux/bin32/../../src/phobos/std/container.d(1612): Error: template std.conv.emplace(T) if (!is(T == class)) does not match any function template declaration dmd2/linux/bin32/../../src/phobos/std/container.d(1612): Error: template std.conv.emplace(T) if (!is(T == class)) cannot deduce template function from argument types !()(T*,T) Is this a bug or I use the binary heap wrongly? Thanks a lot! |
September 22, 2011 Re: Why this simple binaryHeap program does not compile? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Cheng Wei | On 09/22/2011 06:10 AM, Cheng Wei wrote:
>
> Is this a bug or I use the binary heap wrongly? Thanks a lot!
Looks like a bug in Array. emplace doesn't accept a pointer to a chunk for class types.
Report that puppy!
|
September 22, 2011 Re: Why this simple binaryHeap program does not compile? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ellery Newcomer | On 9/22/11 7:20 PM, Ellery Newcomer wrote: > Looks like a bug in Array. emplace doesn't accept a pointer to a chunk > for class types. > > Report that puppy! See https://github.com/D-Programming-Language/phobos/commit/65a0c2158b1d2ea8e9d3094746739da636266089. David |
Copyright © 1999-2021 by the D Language Foundation