D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4355 - random + take = fail
Summary: random + take = fail
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Linux
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-20 18:25 UTC by Ellery Newcomer
Modified: 2010-08-19 21:52 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Ellery Newcomer 2010-06-20 18:25:48 UTC
code:

import std.stdio;
import std.range;
import std.random;
void main(){
    Random r = rndGen();
    foreach(i; take(r,5)){
        writeln("hi ",i);
    }
}

gives:

/usr/lib/dmd-2.047/src/phobos/std/range.d(1289): Error: template std.range.moveFront(R) if (is(typeof(&r.front()) == ElementType!(R)*)) does not match any function template declaration
/usr/lib/dmd-2.047/src/phobos/std/range.d(1289): Error: template std.range.moveFront(R) if (is(typeof(&r.front()) == ElementType!(R)*)) cannot deduce template function from argument types !()(MersenneTwisterEngine!(uint,32,624,397,31,-1727483681u,11,7,-1658038656u,15,-272236544u,18))
Comment 1 David Simcha 2010-08-19 21:52:14 UTC
Fixed 2.048