Boost logo

Boost :

From: Ed Brey (brey_at_[hidden])
Date: 1999-07-12 07:30:08


Email seemed somewhat boring, until Reid Sweatman wrote:
>
>> Also, the sentence "For functions which can throw
>> std::bad_alloc, empty
>> throw specifiers are not supplied." is confusing. Of course empty
>> throw specifiers woundn't be supplied. The issue is why isn't
>> throw(std::bad_alloc) specified. I believe all the functions
>> that throw
>> bad_alloc also contain a delete of the user's type. According to the
>> discussion in this thread, this is a good reason for not
>> having a throw
>> specification.
>
>Let me ask for a clarification here. When you say bad_alloc throws delete
>the user's type, you mean the type that failed of allocation, don't you?

No. If allocation fails, the type being allocated never exists, and so
there is no need to delete it. What gets deleted is the user's type
that is being reference counted, since if the reference count cannot
be allocated, it essentially falls to 0.

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

eGroups.com home: http://www.egroups.com/group/boost
http://www.egroups.com - Simplifying group communications


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