This allows the ranges returned by only to be used in algorithms that
require assignable elements, such as reverse, sort, and transposed.
Fixes bugzilla issue 24382.
Previously, roundRobin would always attempt to fetch its first element
from the first range passed to it, even if that range was empty.
Fixes bugzilla issue 24384.
The requirement for opSlice on an infinite range to return the result of
take or takeExactly was removed in commit c828a08b64, which was included
in Phobos 2.067.0, released in March 2015. However, the documentation
was never updated to take this change into account.
This change updates the documentation and adds a unit test for the "new"
behavior.
Fixes bugzilla issue 24348.
This replaces the bespoke type comparison that was previously used. All
conversions allowed by the previous version are still allowed after this
change.
Rebindable2 is a simplified version of std.typecons.Rebindable that clears up every special case: classes, arrays and structs now have the same struct.
Whichever type you instantiate `Rebindable2` with, you always get the same type out by calling `value.get` on the resulting container.
Also use this type to simplify the parts of Phobos we previously used `Rebindable` for.
`only` is a range that may be *mutable*, but not *assignable*. `chain` falls over here because it assumes it can make a struct with ranges, and reassign them with new values, which isn't necessarily the case even if the ranges are not `const`.
Solved by creating a separate tuple of `Rebindable` ranges for this case.
* Optimised std.range.chain
Chain now remembers which subrange has the first and the last elements,
eliminating needless work on each usage.
* Style fix.
* No longer needless `.empty` calls in the constructor.
* Improvements based on Razvans observations.
combines the very common constraint
`isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R)`
and adds a bunch of documentation with examples for users to understand
it better. This should lower the neccessary needed technical insight to
read basic docs, especially std.path and std.file docs.
Previously, isInfinite!(RandomAccessInfinite!T) would always evaluate to
false, because the 'empty' method inherited from InputRange could not be
evaluated at compile time. Since isRandomAccessRange!R requires
(isBidirectionalRange!R || isInfinite!R), this meant that
RandomAccessInfinite!T was not recognized as a random-access range.
`noreturn[]` does not contain characters and hence is not subject to
autodecoding. The previous behaviour caused the range primitives (`put`,
...) to call into autodecoding related functions which couldn't handle
`noreturn[]`.
That error caused `isInputRange!(noreturn[])` to yield false.