Can C ++ classes with remote methods be trivially copied?

I want class B to inherit everything except a few methods of class A (which are supposed to be trivially copied) and can still be trivially copied. In C ++ 11, I can remove methods. Take for example:

class A { // trivially copyable
   // private stuff here
public:
   A& operator += (const A&);
   // other public stuff here
};

class B: public A {
public:
   B& operator += (const A&) = delete;
};

Is B trivially copied? I know that there are problems with deleting special methods, but compound assignment is not a special method (right?).

+4
source share
2 answers

Yes, Byou can trivially copy - no matter what you do with non-specific member functions.

N3337, ยง9 / 6 :

- , :
- (12.8),
- (12.8),
- (13.5.3, 12.8),
- (13.5.3, 12.8)
- (12.4).

(?)

, .

N3337, ยง12/1:

(12.1), (12.8), (12.8), (12.4) -.

+9

, - A B A ( ), B .

+3

All Articles