On Wed, 24 Dec 2014 00:16:33 +0000 aldanor via Digitalmars-d <[email protected]> wrote:
> alias T = Tuple!(int, "a", double, "b"); > T foo = [1, 2]; // works > T bar; > bar = [1, 2]; // doesn't? > > Wonder if there's an obvious reason to this? you mean "other than the fact that `T foo = [1, 2];` is initalization, not assigning"? ;-) you just stepped into two operations that looking almost the same, but does very different things. the thing is that Tuple supports assigning only from another Tuple. it is possible to build `opAssign` templates to support the case you shown, but it will be cumbersome and will bloat the code. tl;dr: nobody wrote the proper `opAssign` generator. ;-)
signature.asc
Description: PGP signature
