Created on 2011-01-25.00:00:00 last changed 130 months ago
[Voted into the WP at the March, 2011 meeting as part of paper N3262.]
An implicit declaration of a copy assignment operator is deprecated if the class has a user-declared copy constructor or a user-declared destructor. However, the example in 6.7.7 [class.temporary] relies on such an implicit declaration; an explicit declaration for the copy assignment operator for class X should be provided:
class X {
public:
X(int);
X(const X&);
~X();
};
class Y {
public:
Y(int);
Y(Y&&);
~Y();
};
X f(X);
Y g(Y);
void h() {
X a(1);
X b = f(X(2));
Y c = g(Y(3));
a = f(a); // relies on implicitly-declared X::operator=(const X&)
}
History | |||
---|---|---|---|
Date | User | Action | Args |
2014-03-03 00:00:00 | admin | set | status: fdis -> c++11 |
2011-04-10 00:00:00 | admin | set | messages: + msg3363 |
2011-04-10 00:00:00 | admin | set | status: open -> fdis |
2011-01-25 00:00:00 | admin | create |