[cfe-dev] deprecating copy construction and assignment
David Blaikie
dblaikie at gmail.com
Wed Mar 28 11:14:57 PDT 2012
On Wed, Mar 28, 2012 at 11:08 AM, Howard Hinnant <hhinnant at apple.com> wrote:
> In a few instances the implicit definition of a defaulted copy constructor and copy assignment operator is deprecated in C++11. E.g.:
>
> struct A
> {
> // A(const A&) = default; // deprecated
>
> // A& operator=(const A&) = default; // deprecated
>
> ~A();
> };
>
> Should we warn when both -std=c++11 and -Wdeprecated is given?
I believe we should, yes - just that no one's gotten around to
implementing this (it's been somewhere on my mental list).
Aside: It'd be rather nice if these rules actually implemented the
classic "rule of three" (if you implement any of the three you should
implement all three - or 5 in C++11) but I don't think the standard
wording goes quite that far.
- David
>
> Howard
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
More information about the cfe-dev
mailing list