C++
Lucas Goss
lgoss007 at gmail.com
Sat Jul 1 13:40:41 PDT 2006
Walter Bright wrote:
> Lucas Goss wrote:
>> Is there any benefit to having a separate symbol for adding (ok,
>> concatenating)? If not feel free to break the language here too.
>
> Concatenation is quite different from addition:
>
> int[3] a = [1,2,3];
> int[3] b = [4,5,6];
>
> int[] c = a + b; // c[] = [5,7,9]
> int[] d = a ~ b; // d[] = [1,2,3,4,5,6]
>
> Two distinct operators are necessary.
Ah, thanks! That makes sense.
Lucas
More information about the Digitalmars-d
mailing list