digitalmars.D.learn - Why this simple binaryHeap program does not compile?
- Cheng Wei (16/16) Sep 22 2011 import std.container;
- Ellery Newcomer (4/6) Sep 22 2011 Looks like a bug in Array. emplace doesn't accept a pointer to a chunk
- David Nadlinger (4/7) Sep 22 2011 See
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!
Sep 22 2011
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!
Sep 22 2011
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
Sep 22 2011








David Nadlinger <see klickverbot.at>