Steven Schveighoffer wrote:
It's not impossible, but Tango's #1 rule is minimize heap allocations. By peppering idup everywhere, you have created a conflict with the main goal. Refactoring in these cases isn't quite as simple as you say, and it certainly won't be backwards compatible.

If you know the string is unique, you can use cast(string) rather than .idup, and no allocations will be done.


In general, I tried to make Tango for D2 as const aware as possible (it's a standard lib, and shouldn't require people to ignore const), and found all sorts of issues with it (const). The main one that made me quit was the problem that inout is supposed to solve.

Right; inout is intended to fix that.

Reply via email to