nogc Array
Kapps via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Mon Jan 25 20:38:51 PST 2016
On Tuesday, 26 January 2016 at 04:31:07 UTC, Igor wrote:
> On Tuesday, 26 January 2016 at 03:06:40 UTC, maik klein wrote:
>> On Tuesday, 26 January 2016 at 03:03:40 UTC, Igor wrote:
>>> Is there a GC-less array that we can use out of the box or do
>>> I have to create my own?
>>
>> https://dlang.org/phobos/std_container_array.html
>
> How do we use std.algorithm with it? I could like to use find
> but I have no luck.
>
> I have
>
> std.container.array!MyClass classes;
>
> then std.algorithm.find!("a.myInt == b")(classes, 3)
>
> I was hoping this would find the first object in classes who
> has myInt == 3 but I just get many errors about not being able
> to find the right definition.
>
> I guess std.container.array isn't a range? Or am I using it
> wrong?
First, should be std.container.array.Array!MyClass. However I
don't think(?) that the Array struct is a range itself, you might
have to use classes[] instead to get a slice of the array.
More information about the Digitalmars-d-learn
mailing list