Boost logo

Boost :

Subject: Re: [boost] storing intrusive_ptr in atomic?!
From: Giovanni Piero Deretta (gpderetta_at_[hidden])
Date: 2013-10-25 05:25:16


On Fri, Oct 25, 2013 at 10:22 AM, Oliver Kowalke
<oliver.kowalke_at_[hidden]>wrote:

> 2013/10/25 Giovanni Piero Deretta <gpderetta_at_[hidden]>
>
> > 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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk