Turn GC allocated string into a scoped heap allocation

Per Nordlöw per.nordlow at gmail.com
Thu Dec 13 09:38:24 UTC 2018


How do I turn the GC-allocation in toLower() to a scoped heap 
allocation together with toLowerInPlace() in

void 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`?


More information about the Digitalmars-d-learn mailing list