D talk at Silicon Valley ACCU
Rory McGuire via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Tue May 19 04:07:25 PDT 2015
On Mon, May 18, 2015 at 1:57 PM, via Digitalmars-d-announce <
digitalmars-d-announce at puremagic.com> wrote:
> void fibonacciSeries()
>
void fibonacciSeries(T)() if (isIntegral!T) {...}
>
> unittest
> {
> import std.concurrency: yield, Generator;
> auto series = new Generator!int(&fibonacciSeries);
>
auto series = new Generator!int(&fibonacciSeries!int);
> import std.range: take;
> writefln("%(%s, %)", series.take(10));
> }
>
Surely you shouldn't have int in your fibonacci function?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-announce/attachments/20150519/5a4a4be9/attachment.html>
More information about the Digitalmars-d-announce
mailing list