Summary: Double bug regarding Tuple.init
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Andrei Alexandrescu <> 2010-07-07 
13:39:18 PDT ---

import std.stdio, std.typecons;

struct S
    this(this) { writeln("making a copy"); }

void main() {
    Tuple!(S, int) x;
    auto p1 = &(x.init);
    //auto p2 = &(Tuple!(S, int).init);

The program as is calls the copy constructor of S twice. It should call none
(for at least two reasons: effciency and the fact that some types want to
disable copying).

Furthermore, uncommenting the last line in main yields a compile-time error. It
should compile and run (again without invoking the copy constructor).

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to