reading file byLine

Namal via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Sep 6 14:18:26 PDT 2015


> That should be it though... Could you try this minimal complete 
> test?
>
> import std.stdio;
> import std.algorithm;
>
> void main(string[] args) {
>     int[] arr = [1, 2, 4, 2, 3, 4, 1];
>     arr.sort.uniq.writeln;
> }
>
> // [1, 2, 3, 4]

yes, it works likte that.

unique(arr) I get

Error: undefined identifier 'unique', did you mean template 
'uniq(alias pred = "a == b", Range)(Range r) if 
(isInputRange!Range && is(typeof(binaryFun!pred(r.front, 
r.front)) == bool))'?




More information about the Digitalmars-d-learn mailing list