how to sort the container Array from std.container

Flaze07 christianseiji.cs at gmail.com
Wed Jun 6 14:20:50 UTC 2018


On Wednesday, 6 June 2018 at 14:06:54 UTC, rikki cattermole wrote:
> On 07/06/2018 1:58 AM, Flaze07 wrote:
>> On Wednesday, 6 June 2018 at 13:46:41 UTC, Adam D. Ruppe wrote:
>>> On Wednesday, 6 June 2018 at 13:44:09 UTC, Flaze07 wrote:
>>>> sort( arr.Range );
>>>> don't work, it says cannot pass RangeT!(Array!uint) as 
>>>> function argument
>>>
>>> Range is the type, you want the value
>>>
>>> I think you can do
>>>
>>> sort(arr[])
>>>
>>> maybe
>> 
>> I see why it works, so, [] is called slice operator right ?
>> and in 
>> https://dlang.org/phobos/std_container_array.html#.Array.opSlice it returns range, so that's why it worked
>
> Yes.

hmm, and sorry for asking more, what about removing an element 
from it ? I found no remove operation that can remove from the 
middle ( removeAny and removeBack both removes the latest 
element, linearRemove receive Array!uint...which  don't know how 
to provide )


More information about the Digitalmars-d-learn mailing list