On 27.05.2015 13:50, "Simon Bürger" <[email protected]>" wrote:
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?


Do you want to dynamically change priority? Why prio is outside of your predicate?

Reply via email to