[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SV: source



Bjarke Hammersholt Roune wrote:

>> That's only an example - most (if not all) methods in Directory.cpp have
>> std::bad_alloc in their exception specification while their
>> declarations in
>> Directory.h had an throw () (i.e. specified that they throw *nothing*).
>>
>Directory::RemoveFile CAN throw an std::bad_alloc exception. If you look in
>the implementation, you will find that there are actually several calls it
>make than can result in this, notably the DynHashTable constructor and
>HashTable::CreateFromDynHash().

Ok. Missed that.

>I didn't find any places where bad_alloc was specified, but it in reality
>could not be thrown (you fixed this? Or there was no problem?). I did find

I simply added the exception specifications I thought were right because
otherwise the thing wouldn't compile.

>an occurence of the opposite: SetParent() and MakeTopDir() can both throw
>bad_alloc, as they call RemoveDir(), but they did not specify bad_alloc as
>an exception that might be thrown (is fixed in the source I sent you).

Good.


	Christian
-- 

Drive A: not responding...Formatting C: instead