Boost logo

Boost :

From: SourceForge.net (noreply_at_[hidden])
Date: 2005-07-14 09:30:15


Bugs item #1238243, was opened at 2005-07-14 07:30
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1238243&group_id=7586

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: smart_ptr
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Peter Dimov (pdimov)
Summary: shared_ptr/weak_ptr tests are not C++ spec compliant

Initial Comment:
Please refer to the latest C++ spec (Second edition,
2003-04-01), section 12.8.15, "Copying class objects".
Look at your source code in test/weak_ptr_test.cpp.

1. You cannot assume the reference count of the
shared_ptr going into the copy_assignment function is
one. The spec says that compilers are allowed to make
an optimization to eliminate a copy, but not mandated
to do so. This means that the effective reference count
upon entry to the function may be two, not one.

To correct your unit tests, forcibly create a local
object that you pass by value to guarantee the
reference count is two upon entry for all compilers.

To respond to the following email address, remove all
capital Z's.

rZoZbZeZrZt.bZuZcZk_at_[hidden]

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1238243&group_id=7586

-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Boost-bugs mailing list
Boost-bugs_at_[hidden]
https://lists.sourceforge.net/lists/listinfo/boost-bugs


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