Re: Problems instantiating template class

2019-04-06 Thread Mek101 via Digitalmars-d-learn
On Saturday, 6 April 2019 at 18:08:31 UTC, Mek101 wrote: On Saturday, 6 April 2019 at 17:44:25 UTC, Nicholas Wilson wrote: Hmm, import std.traits; class WeightedRandom(T, W = float) if(isNumeric!W) { // Fields private W[T] _pairs; // The total sum of all the weights;

Re: Problems instantiating template class

2019-04-06 Thread Mek101 via Digitalmars-d-learn
On Saturday, 6 April 2019 at 17:44:25 UTC, Nicholas Wilson wrote: Hmm, import std.traits; class WeightedRandom(T, W = float) if(isNumeric!W) { // Fields private W[T] _pairs; // The total sum of all the weights; private W _probabilities; /// Code...

Re: Problems instantiating template class

2019-04-06 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 6 April 2019 at 17:30:45 UTC, Mek101 wrote: I'm rewriting from C# a small library of mine to practice with D. I have a class: class WeightedRandom(T, W = float) if(isNumeric!W) { // Fields private W[T] _pairs; // The total sum of all the weights;