Re: How come a count of a range becomes 0 before a foreach?

2023-04-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/10/23 6:43 PM, ikelaiah wrote: On Monday, 10 April 2023 at 01:01:59 UTC, Steven Schveighoffer wrote: On 4/9/23 9:16 AM, Ali Çehreli wrote:    auto entries = dirEntries(/* ... */).array; I'd be cautious of that. I don't know what the underlying code uses, it may reuse buffers for e.g.

Re: How come a count of a range becomes 0 before a foreach?

2023-04-10 Thread ikelaiah via Digitalmars-d-learn
On Monday, 10 April 2023 at 01:01:59 UTC, Steven Schveighoffer wrote: On 4/9/23 9:16 AM, Ali Çehreli wrote: On 4/8/23 21:38, ikelaiah wrote: > I will modify the code to construct it twice. Multiple iterations of dirEntries can produce different results, which may or may not be what your

Re: How come a count of a range becomes 0 before a foreach?

2023-04-10 Thread ikelaiah via Digitalmars-d-learn
On Sunday, 9 April 2023 at 13:16:51 UTC, Ali Çehreli wrote: On 4/8/23 21:38, ikelaiah wrote: > I will modify the code to construct it twice. Multiple iterations of dirEntries can produce different results, which may or may not be what your program will be happy with. Sticking an .array at

Re: mutable pointers as associative array keys

2023-04-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/10/23 4:25 PM, Steven Schveighoffer wrote: It's also completely useless. Having const keys does nothing to guarantee unchanging keys. Another half-assed attempt to be encode correct semantics but fails completely in its goal. In case you wonder how old this is:

Re: mutable pointers as associative array keys

2023-04-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/10/23 2:14 PM, John Colvin wrote: It seems that it isn't possible, am I missing something? alias Q = int[int*]; pragma(msg, Q); // int[const(int)*] Yep, it's been that way forever. Only with pointers and arrays. It's fine with mutable classes and structs (even if they contain pointers).

Re: DlangUI Layout Justification

2023-04-10 Thread ShadoLight via Digitalmars-d-learn
On Friday, 7 April 2023 at 17:13:58 UTC, Adam D Ruppe wrote: On Friday, 7 April 2023 at 15:52:02 UTC, Ali Çehreli wrote: I don't know how relevant it is but there is also Hipreme Engine that supports Android: [...] One library can help with both games and guis but it is unlikely to be a

Re: mutable pointers as associative array keys

2023-04-10 Thread JG via Digitalmars-d-learn
On Monday, 10 April 2023 at 18:14:56 UTC, John Colvin wrote: It seems that it isn't possible, am I missing something? alias Q = int[int*]; pragma(msg, Q); // int[const(int)*] Also, is this documented somewhere? It seems to be so (which is strange) and I can't image it is by design since you

mutable pointers as associative array keys

2023-04-10 Thread John Colvin via Digitalmars-d-learn
It seems that it isn't possible, am I missing something? alias Q = int[int*]; pragma(msg, Q); // int[const(int)*] Also, is this documented somewhere?