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...
 }

void main()
{
    auto wrnd = new WeightedRandom!char();
}

works for me: https://run.dlang.io/is/CjSubj

My bad. It seems like an invisible character sent the complier crazy. I re-wrote the unittest and now it works...
Weird...

Reply via email to