D-Programming-Language/phobos — pull request #1009 by monarchdodra (2012-12-13 16:55:45+00:00)
Title: imporvements to uninitializedFill && initializeAll

I've had this planned for *months* now, but kept getting sidetracked, in particular, by things like emplace/move and whatnot.

Because they didn't really handle all of the cases correctly. In particular `uninitializedFill`.

I removed support for calling `uninitializedFill` and `initializeAll` for ranges that don't expose references to its members. Trying to support that is (IMO) stupid, and error prone.

In particular, I think it is especially bad design in that it will accept to work if there is no elaborate opAssign. The problem is that if you *do* add a `opAssign` to your type, then your code will stop compiling, as opposed to just taking another branch. This kind of behavior is (again, IMO) bad design.

## initializeAll
The good news is that `initializeAll` was so broken that it didn't compile for ranges that didn't expose references (it used an undefined `filler`). This means it wasn't physically possible to even call it. Ergo, I removed support for this entirely.

I also added an overload to `initializeAll` so that it could operate on narrow (mutable) strings (which was not the case before).

## uninitializedFill
Less change in `uninitializedFill`. I just simplified the branching a little, by adding a deprecated overload for non-hasLvalue ranges.

--------
Added unit tests that at least cover all branches.