This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fw: [patch] Make std::tr1::shared_ptr thread-safe.


On Apr 2, 2005 10:33 PM, Peter Dimov <pdimov@mmltd.net> wrote:
[...]
> struct X
> {
>    int v;
> 
>    X(): v( 0 ) {}
>    ~X() { v = 1; }
> };
> 
> and with several billion repetitions of
> 
> assert( px->v == 0 );
> px.reset();

int v = px->v;
px.reset();
assert(v == 0);

is likely to "fail faster", so to speak.

regards,
alexander.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]