[Issue 9071] sort function won't compile but Range fits describtion

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 27 06:00:31 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=9071



--- Comment #6 from monarchdodra at gmail.com 2012-12-27 06:00:26 PST ---
(In reply to comment #1)
> This is actually a problem with "hasSlicing": It is currently being tightened
> so that the result of a slice operation *must* be convertible back to the
> original type. If this is not the case, then the range will not be considered
> sliceable.
> 
> Once this is deployed, you will (should) be forwarded to the "correct" overload
> of sortImpl: The one that doesn't use slicing.
> 
> Still, could you please provide the code example that fails? This will help us
> figure out which of the following is the culprit:
> * The range?
> * The definition of hasSlicing?
> * The implementation of sort?
> And correctly address the issue.

OK: According to the new tests, the new definition of has slicing partially
fixes the problem. However, there are currently no restraints for "sort", so
the compilation error is:

/usr/local/include/dmd2git/std/algorithm.d(7357): Error: template instance
SortedRange!(Deque, "a < b") SortedRange!(Deque, "a < b") does not match
template declaration SortedRange(Range, alias pred = "a < b") if
(isRandomAccessRange!(Range) && hasLength!(Range))

I'll add a new restraint then.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list