3

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?

SCFrench
  • 8,244
  • 2
  • 31
  • 61
  • 2
    [1402](http://www.open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#1402)? – Lightness Races in Orbit Aug 20 '15 at 14:52
  • @LightnessRacesinOrbit Sounds right? – Barry Aug 20 '15 at 14:56
  • This question is extremely off-topic – Lightness Races in Orbit Aug 20 '15 at 15:06
  • I'm not sure. 1402 still uses the language "has a move constructor", which Parent seemed to find fault with. I guess I'd be looking for something where the proposed fix uses the language "is move constructable" or something like that. Perhaps it doesn't actually exist and Parent was thinking of this instead. – SCFrench Aug 20 '15 at 15:06
  • 3
    Off-topic? Really? I tried to make it a specific, answerable question under the category of "a practical, answerable problem that is unique to software development" – SCFrench Aug 20 '15 at 15:12
  • Sean [comments here](https://channel9.msdn.com/Events/GoingNative/2013/Inheritance-Is-The-Base-Class-of-Evil#c635183067758942207) specifically about defect 1402 in regards to another talk. Whether that's the *specific defect* that he couldn't remember off the top of his head would probably require an answer directly from him. – Drew Dormann Aug 20 '15 at 16:56
  • Well, if @Sean Parent wants to answer this, I'd *definitely* up-vote it. :-) – SCFrench Aug 20 '15 at 17:03

1 Answers1

4

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


Sean Parent
  • 693
  • 5
  • 10