I am trying to use a Container class with a custom predicate, but the following code does not compile. Any hints on how to do it?

import std.container;

class C
{
    int[] prio;
    RedBlackTree!(int, (a,b)=>prio[a]<prio[b]) tree;
}

I think I understand the reason why this does not work (the lambda cannot access the 'this' to get to 'prio'), but I can't think of a way to make it work. Any Ideas?


Reply via email to