How to return a reference to structs?

Andrey Zherikov andrey.zherikov at
Sat Nov 6 15:57:23 UTC 2021

On Saturday, 6 November 2021 at 13:57:47 UTC, Ali Çehreli wrote:
> Have you considered std.range.indexed, which should at least 
> cover the case of accessing:

I don't need to iterate over whole collection, but subset of it.

> Can you give a little more context for others to come up with a 
> better answer?

I have a [CLI-parsing 
library]( that 
creates a set of argument objects based on UDAs. They are [stored 
array]( right now. I want to introduce some grouping having something like `struct Group { size_t[] args; }` but face the problem of addressing the objects. As of now I need to be able to iterate over the arguments within a group as well as those that satisfy some condition.

More information about the Digitalmars-d-learn mailing list