Printing Tuple!(...)[] using for loop?

Alexandru Ermicioi alexandru.ermicioi at gmail.com
Fri Jul 2 07:53:29 UTC 2021


On Friday, 2 July 2021 at 04:21:24 UTC, Kirill wrote:
> ...

1. use static foreach for tuple loop.
2. start column and end column should be known at compile time. 
Either make them immutable, or as enum constant, or pass them as 
an template argument.

Tuple is basically a wrapper over built in tuple support from D. 
Check it's insides to se how it is done. So to index a field in a 
tuple you need to know which field you want to access at compile 
time since, each field in a tuple has different size, and cannot 
be indexed at runtime easily.

Best regards,
Alexandru.


More information about the Digitalmars-d-learn mailing list