[pending/relaxed_heap.hpp] assert problem

Using relaxed_heap I'm getting a problem with the asserts in the top() and pop() functions: assert(smallest_value->value != 0); Where value is a ::boost::optional<T>, and T is the indexed type of the heap. The problem that I'm having is that when my T is an int, and the int in question is perfectly valid and has an initialised value of zero, it fails the assert test. Based on my limited understanding, we would actually want to be asserting either (smallest_value != 0) since smallest_value is a pointer, or (smallest_value->value.is_initialised()) since this is an optional. Apologies if I have misunderstood something, as I am a newcomer to boost. Many thanks, Paul. --------------------------- Paul Dawson BAE Systems (Operations) Limited Registered Office: Warwick House, PO Box 87, Farnborough Aerospace Centre, Farnborough, Hants, GU14 6YU, UK Registered in England & Wales No: 1996687 ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ********************************************************************

On Mar 4, 2008, at 11:19 AM, Dawson, Paul (UK Filton) wrote:
Using relaxed_heap I'm getting a problem with the asserts in the top() and pop() functions:
assert(smallest_value->value != 0);
Where value is a ::boost::optional<T>, and T is the indexed type of the heap.
That "0" should be "none" (from boost/none.hpp); this bug is fixed in Boost 1.35.0 and on the Boost development trunk. - Doug
participants (2)
-
Dawson, Paul (UK Filton)
-
Doug Gregor