D-Programming-Language/phobos — pull request #1930 by monarchdodra (2014-02-12 14:08:19+00:00)
Title: intorduce package level emplace

Overall, useage of `emplace` has revealed that the whole "pass by pointer" is a real hindrance for trying to use in safe code, or with ranges. It has lead us to using horrible "trustedGetAddress" helpers, and tons of other conditional crap.

As of today, emplace is mostly safe (as safe as can legally be anyways), and with inlining, it gets entirely optimized away for trivial types. As for non-inline builds, the cost is not that high.

Having an emplace that takes by ref makes it much more trivial and easy to use, and will promote its useage. Furthermore, it keeps things "potentially safe" by default, rather than immediately unsafe due to pointer manipulation.

So, what this pull does:
1. Rewrite `emplace` for `emplaceRef` to take by reference. This actually changes virtually nothing to the code.
2. Use `emplaceRef` in lieu of emplace: This cleans up a fair bit of code.
3. Bit of cleanup/reorg in `std.conv`.

Currently, `emplaceRef` is only a package function: I want to use it immediately to cleanup phobos. We can discuss about making it public, or "migrating", but that isn't the immediate point of the pull