On Fri, Oct 25, 2013 at 10:22 AM, Oliver Kowalke
2013/10/25 Giovanni Piero Deretta
Intrusive_ptr doesn't have tivial copy constructor (how could it have? it needs to update the counter), ergo is not trivially copyable and the above two point do not apply.
but the standard says 'trivially copyable' not 'trivial copy constructor' - e.g. the code examples by the standard document gives correct results for intrusive_ptr (because all criteria are fulfilled). does this mean the standard document contains a false wording/examples?
I do not have the standard at hand, but a trivially copyable class is a class that: 1. Has no non-trivial copy constructors (this also requires no virtual functions or virtual bases) 2. Has no non-trivial move constructors 3. Has no non-trivial copy assignment operators 4. Has no non-trivial move assignment operators 5. Has a trivial destructor [from cppreference.com, which may or may not be authoritative] -- gpd