count until predicate returns false

Andrej Mitrovic andrej.mitrovich at gmail.com
Mon Aug 15 15:15:52 PDT 2011


That doesn't work:

import std.algorithm;
import std.stdio;
import std.functional;
import std.uni;

void main()
{
    auto line = "  foo";
    writeln(countUntil!(not!isWhite)(line));
}

test.d(9): Error: template std.algorithm.countUntil(alias pred = "a ==
b",R1,R2) if (is(typeof(startsWith!(pred)(haystack,needle)))) does not
match any function template declaration
test.d(9): Error: template std.algorithm.countUntil(alias pred = "a ==
b",R1,R2) if (is(typeof(startsWith!(pred)(haystack,needle)))) cannot
deduce template function from argument types !(not)(string)
test.d(9): Error: template instance errors instantiating template


More information about the Digitalmars-d-learn mailing list