On 04/07/2011 01:04 AM, spir wrote:
> On 04/07/2011 09:52 AM, spir wrote:
>> On 04/07/2011 03:07 AM, Ali Çehreli wrote:
>>>> Given an array of strings std.string.join() returns a single string:
>>>>
>>>> import std.string;
>>>> void main() {
>>>> string[] a1 = ["hello", "red"];
>>>> string j1 = join(a1, " "); // OK
>>>> }
>>>>
>>>>
>>>> But in a program I need an array of mutable arrays of chars. If I
>>>> join the
>>> arrays I get a mutable array of chars.
>>> [...]
>>> Finally, casting ourselves works:
>>>
>>> string j2 = cast(string)join(a2, " ");

> Questions: did you know this idiom? if yes, have you found it yourself
> or read about it? if the latter, where?

I had heard about assumeUnique() a couple of times in these forums. I remember looking at its implementation.

Ali

Reply via email to