=== is duplicated by: S1234

=== relates to: S4963

=== on 1 Jun 2016, 17:29:31 Ann Campbell wrote:
\[~alban.auzeill], you mentioned in our discussion something about not raising false positives when the move constructor and move-assignment operator are missing. I didn't really get the details of that, so it's not included here and we'll probably need to add it. Feel free to stub the details in or add them in a comment.


Also, I've changed the code samples from IntPointers to FooPointers & added a second compliant solution, which you'll probably want to take a look at.




=== on 8 Jun 2016, 17:40:06 Ann Campbell wrote:
I've made some edits [~alban.auzeill]. Take a look, please.

=== on 15 Aug 2016, 18:05:28 Ann Campbell wrote:
\[~alban.auzeill] this description is extremely long, and I'd like to shorten it by removing some or all of the {cpp} 98 and {cpp} 11 history. Given that you'll have final approval, do you mind if I go ahead?

=== on 6 Nov 2018, 17:57:54 Ann Campbell wrote:
\[~loic.joly] I find this contradictory


____ ... If you cannot find a way to implement them more efficiently than the copy operations, you can just leave them out.

Those operations work together, and letting the compiler automatically generate some of them, but not all, means that when one of those functions is called, the integrity of the resource will probably be compromised____

=== on 6 Nov 2018, 18:13:53 Loïc Joly wrote:
\[~ann.campbell.2] It's not really contradictory, because as soon as a copy constructor is written by the user, it disables the automatic generation of the move constructor, so we're not letting the compiler do anything. But I see your point, it's confusing...


With that additional information, do you have a counter proposal that is not adding too much text to this already long description?



=== on 22 Nov 2018, 15:14:57 Amélie Renard wrote:
Cases which could need an explanation :


* Destructor is defined in order to check that the object can really be destroyed (use of assert())
ex : \https://peach.sonarsource.com/project/issues?id=c-family%3Aclang&issues=AWczye3UUxytsEdVyqlH&open=AWczye3UUxytsEdVyqlH

(bad example because the class has a reference attribute - but the idea is there)


* Copy constructor and copy assignment operator are defined to keep a counter (or something like that)

* An attribute is a unique_ptr. So the user defines the copy constructor and the copy-assignment operator to copy what is inside the unique_ptr. But there is no need of a destructor as the unique_ptr takes care of it.
ex : \https://peach.sonarsource.com/project/issues?id=c-family%3Aclang&issues=AWczyhmIUxytsEdVyqnR&open=AWczyhmIUxytsEdVyqnR


* Class which defines the copy constructor and/or copy-assignment operator when it does not need to. This class should apply the "Rule-of-Zero".



