MISRA Discussion Forums
Do implicitly generated copy-assignment operators count? - Printable Version

+- MISRA Discussion Forums (https://forum.misra.org.uk)
+-- Forum: MISRA C++ (https://forum.misra.org.uk/forumdisplay.php?fid=18)
+--- Forum: MISRA C++:2008 rules (https://forum.misra.org.uk/forumdisplay.php?fid=19)
+---- Forum: 6.12 Special member functions (C++) (https://forum.misra.org.uk/forumdisplay.php?fid=141)
+---- Thread: Do implicitly generated copy-assignment operators count? (/showthread.php?tid=578)



Do implicitly generated copy-assignment operators count? - gs - 09-09-2008

Rule 12-8-2 states:
Quote:The copy assignment operator shall be declared protected or private in an abstract class.
Does this prohibition also include the implicitly generated copy assignment operator? When implicitly generated, ISO C++, 12.8, p. 10, states:
Quote:An implicitly-declared copy assignment operator is an inline public member of its class.
So, does the following code comply with rule 12-8-2:
Code:
class A
    {
    virtual void b() = 0;
    };
?


Re: Do implicitly generated copy-assignment operators count? - misra cpp - 11-10-2016

Yes, as by default they are public. The code does not comply with 12-8-2 as the copy assignment operator is not private or protected