Boost logo

Boost :

From: Matthias Troyer (troyer_at_[hidden])
Date: 2002-06-04 10:31:52


On Tuesday, June 4, 2002, at 04:10 PM, Peter Dimov wrote:

> From: "Giovanni Bajo" <giovannibajo_at_[hidden]>
>>
>> I need it mainly for the smart pointers
>
> Do you need weak_ptr? shared to weak conversions rely on exceptions.
> Also,
> what is supposed to happen when the allocation of the reference count
> fails?

I have converted lexical_cast and the smart pointers to work
without exceptions since I also need them on compilers which do not
correctly implement exceptions. My approach was to write a status
message to std:cerr and terminate with abort() whenever an exception
occurs, e.g. when the allocation of the reference count fails. This
behavior
is encapsulated in a separate function which can be customized if a user
wants
a different behavior (e.g. in embedded systems)

Regarding weak to shared conversion, I do not need them and would propose
to just disable this feature when exceptions are disabled. If anybody
needs this conversion and exceptions disabled, one could think of a
workaround to this problem.

Matthias


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