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
On 5/27/15 9:59 AM, Meta wrote:
I thought unaryFun *does* work with all callables, including
structs/classes with opCall?
It (binaryFun actually) declares an alias. But you need an actual
instance to use in this case. You simply can't declare that in a type
definition, and it won't be set
On 5/27/15 9:11 AM, Simon =?UTF-8?B?QsO8cmdlciI=?=
simon.buer...@rwth-aachen.de wrote:
On Wednesday, 27 May 2015 at 14:58:39 UTC, drug wrote:
Do you want to dynamically change priority?
Actually yes. In my actual code I am not using a RedBlackTree but my own
Container (a heap with the
On 05/27/2015 05:30 PM, Steven Schveighoffer wrote:
On 5/27/15 9:11 AM, Simon =?UTF-8?B?QsO8cmdlciI=?=
simon.buer...@rwth-aachen.de wrote:
On Wednesday, 27 May 2015 at 14:58:39 UTC, drug wrote:
Do you want to dynamically change priority?
Actually yes. In my actual code I am not using a
On Wednesday, 27 May 2015 at 15:30:28 UTC, Steven Schveighoffer
wrote:
On 5/27/15 9:11 AM, Simon =?UTF-8?B?QsO8cmdlciI=?=
simon.buer...@rwth-aachen.de wrote:
On Wednesday, 27 May 2015 at 14:58:39 UTC, drug wrote:
Do you want to dynamically change priority?
Actually yes. In my actual code I am
On 27.05.2015 13:50, Simon Bürger simon.buer...@rwth-aachen.de 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])
On Wednesday, 27 May 2015 at 14:58:39 UTC, drug wrote:
Do you want to dynamically change priority?
Actually yes. In my actual code I am not using a RedBlackTree but
my own Container (a heap with the possibility to modify elements
inside), which is notified when prio changes so it can do a
On Wednesday, 27 May 2015 at 17:56:27 UTC, Steven Schveighoffer
wrote:
On 5/27/15 9:59 AM, Meta wrote:
I thought unaryFun *does* work with all callables, including
structs/classes with opCall?
It (binaryFun actually) declares an alias. But you need an
actual instance to use in this case.