C++ still doesn't have good loop syntax

H. S. Teoh hsteoh at qfbox.info
Wed Jul 15 22:38:23 UTC 2026


On Wed, Jul 15, 2026 at 07:36:47PM +0000, user1234 via Digitalmars-d wrote:
> On Wednesday, 15 July 2026 at 19:23:50 UTC, Kapendev wrote:
> > On Wednesday, 15 July 2026 at 19:06:50 UTC, user1234 wrote:
[...]
> > The other solution I can think of that Nim is doing something like
> > this:
> > ```d
> > auto static_array = $[1, 2, 3]; // int[3]
> > ```
> > 
> > You can replace the `$` with any character, not important.
> 
> Yes sure, in the great tradition of D we could also imagine a DotExp
> property, i.e
> 
> ```d
> auto static_array = [1, 2, 3].staticarrayof;
> ```
[...]

Umm... we already have std.array.staticArray.  This works today:

```
import std.array;
auto static_array = [1, 2, 3].staticArray;
```


T

-- 
This is not a sentence.


More information about the Digitalmars-d mailing list