[Issue 1288] Variables with type tuple as type should be able to act as lvalues
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Jun 27 01:08:21 PDT 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1288
onlystupidspamhere at yahoo.se changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |CLOSED
------- Comment #2 from onlystupidspamhere at yahoo.se 2007-06-27 03:08 -------
(In reply to comment #1)
> IMO, your code should be as following:
>
> import std.bind;
>
> void main() {
> Tuple!(int,int) foo;
>
> foo = Tuple!(int,int)(1,1);
> }
>
> And the compiler emits the correct message IMO
std.bind uses parametrized structs as tuples, that's why the assignment works.
It's simply a workaround. IIRC you can see from the executable that those
assignments generate unnecessary runtime code.
> If this is something about first class tuple, it's already on bug 1293
For most parts, yes. I left this open because it's a easier to implement and I
could have use for it without having e.g. tuple literals. But I'll leave this
closed now.
> But I don't think D is gonna integrate such obscure builtin tuple.
> And even first class tuple gets integrated , I still consider your code
> shouldn't work
I would leave that for Walter to decide.
--
More information about the Digitalmars-d-bugs
mailing list