Open
Description
This code fails to compile
void main()
{
import std.algorithm.iteration : splitter;
import std.algorithm.searching : canFind;
import std.typecons : Yes;
auto range = "16x16+0-2".splitter!((a, b) => "x+-".canFind(a), Yes.keepSeparators)("x");
}
giving
q.d(7): Error: `std.algorithm.iteration.splitter` called with argument types `(string, string)` matches multiple overloads exactly:
/usr/local/include/dmd/std/algorithm/iteration.d(5338): `std.algorithm.iteration.splitter!((a, b) => "x+-".canFind(a), Flag.yes, string, string).splitter(string r, string s)`
and:
/usr/local/include/dmd/std/algorithm/iteration.d(5909): `std.algorithm.iteration.splitter!((a, b) => "x+-".canFind(a), Flag.yes, string, string).splitter(string r, string s)`
auto range = "16x16+0-2".splitter!((a, b) => "x+-".canFind(a), Yes.keepSeparators)("x");
^
This is contrast to
void main()
{
import std.algorithm.iteration : splitter;
import std.algorithm.searching : canFind;
import std.typecons : Yes;
auto range = "16x16+0-2".splitter!((a, b) => "x+-".canFind(a), Yes.keepSeparators)('x');
}
which compiles just fine (though is buggy with front
as shown in #10759).
So, the template constraints need work.
Metadata
Metadata
Assignees
Labels
No labels