Summary: Ambiguity when using std.algorithm.splitter with
                    generic ranges
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from David Simcha <> 2010-06-29 19:11:19 PDT ---
import std.algorithm;

struct Range {
    int[] nums = [1,2,3,4,5,6,7,8,9,10];

    @property int front() {
        return nums[0];

    void popFront() {
        nums = nums[1..$];

    @property bool empty() {
        return nums.length == 0;

    @property typeof(this) save() {
        return this;

void main() {
    Range r;
    auto split = splitter(r, 5);

d:\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(845): Error: template
instance Splitter!(Range,int) matches more than one template declaration,
if (is(typeof(ElementType!(Range).init == Separator.init))) and
isTerminator,Range,Slice =
d:\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(846): Error:
Splitter!(Range,int) is used as a type
d:\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(852): Error: function
expected before (), not void of type void
d:\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(25): Error: template
instance std.algorithm.splitter!(Range,int) error instantiating
test9.d(25): Error: variable test9.main.split voids have no value
test9.d(25): Error: expression splitter(r,5) is void and has no value

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to