December 12, 2015 Re: How is `auto` and not `alias` appropriate for alias sequences? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Shriramana Sharma | On Saturday, 12 December 2015 at 06:15:10 UTC, Shriramana Sharma wrote: > Another twist to this is that the tuple created by .tupleof doesn't really seem to be a new object of type Tuple!() Correct. There's no relation between Tuple and what .tupleof produces. The notion of what constitutes a "tuple" in D is somewhat complicated. > So the exact nature of the object produced by .tupleof is still a mystery to me. Would be good if someone threw more light on it. It's more or less a type internal to the compiler that shares some of its properties with AliasSeq, but I believe that it's subtly different, such as what you mentioned about it being a "view" on a struct/object. > Also: what is the use of presenting the members of a struct/class as a tuple? Is it iteration? Yes, and I also believe that assigning to the .tupleof of a struct/object bypasses protected/private. | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply