Why is std.algorithm so complicated to use?

Jonathan M Davis jmdavisProg at gmx.com
Tue Jul 10 00:25:27 PDT 2012


On Monday, July 09, 2012 22:09:54 Jacob Carlborg wrote:
> Almost every time I'm trying to use std.algorithm I run into some kind
> of error, for what seems to be fairly trivial and what one would expect
> to work. It feels like I'm constantly fighting with std.algorithm. For
> example:
> 
> import std.algorithm;
> import std.range;
> 
> struct Foo {}
> 
> auto f = Foo();
> auto foos = [f];
> auto foo = foos.map!(x => "foo");
> auto bar = foo.chain("bar");
> 
> This simple example result in the follow error:
> 
> http://pastebin.com/E4LV2UBE
> 
> Another example:
> 
> auto str = ["foo", "bar"].map!(x => x);
> auto f = str.sort();
> 
> Results in:
> 
> http://pastebin.com/BeePWQk9
> 
> I'm using DMD 2.059.

http://d.puremagic.com/issues/show_bug.cgi?id=8367
http://d.puremagic.com/issues/show_bug.cgi?id=8368

- Jonathan M Davis


More information about the Digitalmars-d mailing list