Re: when should ranges be static

2025-02-16 Thread Inkrementator via Digitalmars-d-learn
On Saturday, 15 February 2025 at 19:21:33 UTC, monkyyy wrote: On Saturday, 15 February 2025 at 11:47:58 UTC, Inkrementator wrote: Would you expect that style change would remove this flavor of bugs? Do you think this is a compiler bug? It looks similar to this: https://github.com/dlang/dmd/issu

Re: when should ranges be static

2025-02-15 Thread monkyyy via Digitalmars-d-learn
On Saturday, 15 February 2025 at 11:47:58 UTC, Inkrementator wrote: I put `r.findnext!(i => F(i))` instead of `r.findnext!(F)`. I h I would consider that a compiler bug if that ever changed the behavior but I see how that may de-confuse the compiler. Would you expect that style change wo

Re: when should ranges be static

2025-02-15 Thread Inkrementator via Digitalmars-d-learn
On Saturday, 15 February 2025 at 11:47:58 UTC, Inkrementator wrote: Wrapping foo in another delegate seems to at least compile. Same as splitting out the struct. I don't understand why a struct outside of a function gets treated differently than a static struct. ``` auto split(alias F,R)(R

Re: when should ranges be static

2025-02-15 Thread Inkrementator via Digitalmars-d-learn
On Thursday, 6 February 2025 at 20:08:36 UTC, monkyyy wrote: I have template hell code; eventually 5 nested range calls have dual context-y issues and maybe compiler bugs; adding static makes those errors go away, adding static to everything makes new bugs. Wack-a-mole when the compiler gets