A Discussion of Tuple Syntax
Dicebot
public at dicebot.lv
Tue Aug 20 08:54:36 PDT 2013
On Tuesday, 20 August 2013 at 15:43:39 UTC, Kenji Hara wrote:
> On the other hand, std.typecons.Tuple is a struct. Its second
> field has the
> memory address which follows of the first field.
Yes but as you have said exact storage of built-in tuple elements
is not defined - it can be distinct elements or struct fields,
compiler is free to chose any. I am not asking about internal
implementation but about behavior observable by user in typical
cases - it is most important topic here.
> Automatically packing/unpacking would need hidden runtime cost.
Will it be any more costly then returning std.typecons.Tuple and
unpacking it manually? And, well, do we have _any_ other option
of returning a tuple with no runtime costs right now anyway?
Considering we are far away from stable ABI that does not seem to
be a real issue.
More information about the Digitalmars-d
mailing list