On 8/26/10 13:16 PDT, Steven Schveighoffer wrote:
On Thu, 26 Aug 2010 16:05:00 -0400, Mathias Laurenz Baumann
<[email protected]> wrote:

Well, topic says it all. Why is the string parameter for the Exception
class in object.di an immutable(char[])?

A const(char[]) works for both, immutable(char[]) types and char[]
types. why this limitation?

Normally, I'd agree with you, but if the exception gets a
immutable(char)[], it can store it without duplication, and without
worry it will change it.

If you passed in a const, then you'd *have* to duplicate it.

If you have a char[] or a const(char)[] that you want to pass in, call
idup on it.

Better yet: to!string(whatever). Leaves actual immutable stuff non-duplicated/

Andrei

Reply via email to