C++ still doesn't have good loop syntax
user1234
user1234 at 12.de
Wed Jul 15 21:11:24 UTC 2026
On Wednesday, 15 July 2026 at 19:53:40 UTC, Kapendev wrote:
> On Wednesday, 15 July 2026 at 19:52:14 UTC, Kapendev wrote:
>>>
>>> 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;
>>> ```
>>>
>>> 🙃
>>
>> This one is OK too, just paying for a template there.
>> The good thing about it is that it's not a language change.
>> Now, the choice between what `[item1, item2]` should be by
>> default is not important in my opinion, but I get it being
>> weird or annoying for some.
>
> Ah, it's not the thing from the standard library. Anyway, same
> thing.
yeah you got it finally, it's about checking that during
compilation directly.
if the RHS is an Ident and if that ident is
`ident(staticarrayof)`, then let's type the exp as a static array
instead.
anyway, life is so.
That would add some complexity tho. The goal of a language
(compared to another, older) is to avoid those special case
actually.
More information about the Digitalmars-d
mailing list