On Friday, 25 April 2014 at 12:42:33 UTC, bearophile wrote:
Dicebot:

Well, wrong :) std.typecons.Tuple IS a struct - https://github.com/D-Programming-Language/phobos/blob/master/std/typecons.d#L388

Nope, that's just an implementation detail. They are two quite different data structures. Example: slicing a tuple always has a meaning, while slicing a struct is in general meaningless.

Bye,
bearophile

It was what you want it to be, not what it is :) Slicing a struct is absolutely routine thing as struct is just a user-defined aggregate type. std.typecons.Tuple is just a subset of all structs implementing specific behavior. It still acts as struct everywhere when applicable.

Don't confuse std.typecons.Tuple and built-in template argument lists. Latter are indeed special type system entities. Former is just a smart struct.

Reply via email to