Boost logo

Boost :

From: Dawson, Paul (UK Filton) (Paul.Dawson3_at_[hidden])
Date: 2008-03-04 11:19:35


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.
********************************************************************


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