On 12/13/18 4:38 AM, Per Nordlöw wrote:
How do I turn the GC-allocation in toLower() to a scoped heap allocation together with toLowerInPlace() invoid f(const scope const(char)[] expr) { import std.uni : toLower; loweredExpr = toLower(expr); // temporary // use loweredExpr as key in hash table } when `loweredExpr` is used as a temporary inside `f`?
If you use loweredExpr as a key in a builtin AA, then you need to make it a heap allocation, because the GC cleans up AAs.
-Steve