Search code examples
c++language-specifications

What defect report is Sean Parent referring to in his GBC - Implement Complete Types talk


In Sean Parent's talk Goals for Better Coding - implement Complete Types at 44:10-44:50 Sean says something to the effect of

If I put this [class with a copy assignment operator that accepts its parameter by value, and also has a move constructor] as a member of another class, that other class will not get a default move constructor because the language in the spec does not say "if it is move constructable" it says "has a move constructor with this signature". There is a defect on it, I don't know [what it is] off the top of my head.

Can anyone point me to the actual defect report that Sean is referring to?


Solution

  • I was referring to 1402. From a personal correspondence with Howard Hinnant, Jan. 22, 2013:


    from: Howard Hinnant

    Re: Pass by value assignment (again)

    Hi Sean,

    On Jan 22, 2013, at 1:26 PM, Sean Parent wrote:

    I'd like to quote the spec on why this happens - can you send me a pointer to the rule that causes the copy? I'm having a hard time finding the exact rule myself.

    See:

    http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1402

    Skip to the bottom of the issue where the most current proposed wording is. The problematic sentence for your case is in change item 4, the 6th bullet which is proposed to be removed.

    We, meaning Jason, Lawrence, Michael and myself, agreed on this direction at the Portland meeting last Oct. Jason provided the detailed proposed resolution. Now we just need to get the issue voted into the WP and implemented (at least in clang). I just checked tip-of-trunk clang and it still isn't implemented.

    If you were to say, post this example on , point to CWG 1402, and jump up and down explaining how idiotic and harmful the current behavior is, I'll bet Richard Smith would just go ahead and implement CWG 1402. :-)

    Howard