Re: 'each' can take static arrays

2022-06-10 Thread mw via Digitalmars-d-learn
On Friday, 10 June 2022 at 17:27:13 UTC, Adam D Ruppe wrote: On Friday, 10 June 2022 at 16:59:04 UTC, Ali Çehreli wrote: Why the inconsistency? Phobos has dozens of random special cases throughout. I'd prefer if these were all removed, but right now there's just some functions that special

Re: 'each' can take static arrays

2022-06-10 Thread Adam D Ruppe via Digitalmars-d-learn
On Friday, 10 June 2022 at 16:59:04 UTC, Ali Çehreli wrote: Why the inconsistency? Phobos has dozens of random special cases throughout. I'd prefer if these were all removed, but right now there's just some functions that special case to allow it and others that don't. Apparently each is

'each' can take static arrays

2022-06-10 Thread Ali Çehreli via Digitalmars-d-learn
I know static arrays are not ranges but somehow they work with 'each'. With map, I need to slice as 'arr[]': import std; void main() { int[3] arr; arr.each!(e => e);// Compiles // arr.map!(e => e); // Fails to compile arr[].map!(e => e); // Compiles } Why the inconsistency?