updated mir interface

Alex sascha.orlov at gmail.com
Wed Nov 7 09:33:32 UTC 2018


I'm referring to the example
http://docs.random.dlang.io/latest/mir_random_algorithm.html#.sample

Could somebody tell me, why

´´´
import mir.random.algorithm;
import std.range; //import mir.range;

void main()
{ // line 5
	size_t[] arr;
	arr.length = 42;
	arr = arr.length.iota.array;
	auto res = rne.sample(arr, 1);
} // line 10
´´´
refuses to compile?

The error message is

/Users/alex/.dub/packages/mir-random-2.1.1/mir-random/source/mir/random/algorithm.d(551,23): Error: no property popFrontExactly for type ulong[]
/Users/alex/.dub/packages/mir-random-2.1.1/mir-random/source/mir/random/algorithm.d(558,13): Error: template instance `mir.random.algorithm.RandomSample!(MersenneTwisterEngine!(ulong, 64LU, 312LU, 156LU, 31LU, 13043109905998158313LU, 29LU, 6148914691236517205LU, 17LU, 8202884508482404352LU, 37LU, 18444473444759240704LU, 43LU, 6364136223846793005LU), ulong[]).RandomSample.__ctor!()` error instantiating
/Users/alex/.dub/packages/mir-random-2.1.1/mir-random/source/mir/random/algorithm.d(448,35):        instantiated from here: __ctor!()
source/app.d(9,23):        instantiated from here: 
sample!(MersenneTwisterEngine!(ulong, 64LU, 312LU, 156LU, 31LU, 
13043109905998158313LU, 29LU, 6148914691236517205LU, 17LU, 
8202884508482404352LU, 37LU, 18444473444759240704LU, 43LU, 
6364136223846793005LU), ulong[])
dmd failed with exit code 1.


More information about the Digitalmars-d-learn mailing list