D-Programming-Language/phobos — pull request #1010 by monarchdodra (2012-12-14 07:50:15+00:00)
Title: Consolidating Range traits

Specifically:

`hasMobileElements`/`hasAssignableElements`/`hasLvalueElements`/`hasSwappableElements`

They will now all require to be input ranges. The previous requirements were inconsistent and were:
* `hasMobileElements`: Nothing
* `hasAssignableElements`: Forward range
* `hasLvalueElements`: Forward range
* `hasSwappableElements`: Forward range

Furthermore, for these traits we will now also verify that the property holds true for `back` on bidirectional ranges, as well as `index` for RA. (This allowed me to catch that `Array!bool.range` did not, in fact, have back assign).

* `hasMobileElements`: Already present: simplified code
* `hasAssignableElements`: Added tests
* `hasLvalueElements`: Added tests
* `hasSwappableElements`: Added tests

Finally, for `hasMobileElements`, we also verfy that the returned type is equivalent to the type returned by front. This is consistent with the checks required of `isBidirectionalRange` or `isRandomAccessRange`

--------
Fianlly, I added `string`/`dstring`/`char[]`/`dchar[]` tests in the unittests. This should help clear up what string types have which traits (which is not always obvious for newcomers).

Also unlocked the @@@6336 unittest, since it was fixed.