Skip to content

Commit

Permalink
Merge pull request #2473 from quickfur/issue13393
Browse files Browse the repository at this point in the history
Fix regression 13393: cartesianProduct + joiner = runtime assertion failure
  • Loading branch information
monarchdodra committed Aug 29, 2014
2 parents b61d9fa + 6e31087 commit dd4b204
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions std/algorithm.d
Expand Up @@ -13262,6 +13262,7 @@ auto cartesianProduct(RR...)(RR ranges)
copy.ranges[i] = r.save;
copy.current[i] = current[i].save;
}
copy.empty = this.empty;
return copy;
}
}
Expand Down Expand Up @@ -13294,6 +13295,12 @@ unittest
assert(cprod.init.empty);
}

unittest
{
// Issue 13393
assert(!cartesianProduct([0],[0],[0]).save.empty);
}

/// ditto
auto cartesianProduct(R1, R2, RR...)(R1 range1, R2 range2, RR otherRanges)
if (!allSatisfy!(isForwardRange, R1, R2, RR) ||
Expand Down

0 comments on commit dd4b204

Please sign in to comment.