On Saturday, 18 August 2012 at 11:35:59 UTC, Salih Dincer wrote:
So, that's not this a bug?
char[] a = [ 'a', 'b', 'c' ];
char[] b = cast(char[])"abc";
assert(a == b); /* no problem! */
assert(typeid(a) ==
typeid(b));/* no problem! */
// v--- TOGGLE CODE
//a[0] = '
On 08/18/2012 02:15 PM, Salih Dincer wrote:
This may be the solution...:)
char[] b = cast(char[])"abc".dup; // ok, unique reference
Sorry...
You don't need the cast in this case.
Topic: It is not a bug, but it might be surprising because the
behaviour of typeid is different with polymorphic
This may be the solution...:)
char[] b = cast(char[])"abc".dup; // ok, unique reference
Sorry...
So, that's not this a bug?
char[] a = [ 'a', 'b', 'c' ];
char[] b = cast(char[])"abc";
assert(a == b); /* no problem! */
assert(typeid(a) ==
typeid(b));/* no problem! */
// v--- TOGGLE CODE
//a[0] = 'A'; /*
b[0] = 'A'; /* there is problem: