Why does toStringz return an immutable(char)*?

Adam D. Ruppe destructionator at gmail.com
Sat Jun 18 20:59:26 PDT 2011


I don't know if it does this, but immutable could avoid copying:

string a = "hello\0";

auto c_str = toStringz(a);

assert(c_str is a.ptr); // it already fit the bill so no change needed


More information about the Digitalmars-d mailing list