8 Mar
2006
8 Mar
'06
11:05 p.m.
On 3/6/06, Peter Dimov
Scott Meyers wrote:
They are documented not to throw, yet both call intrusive_ptr_add_ref. How can it be that the top constructor above may throw, but these constructors may not?
You are right, this is a documentation bug (similarly for operator=). The "// never throws" annotations aren't present in the synopsis. Fixed in CVS, thanks for the report.
It might be a good idea to add a note about how intrusive_ptr_add_ref is expected to behave if it does throw. It seems to be implied that when an exception is thrown, it shouldn't change the reference count, and should destroy the object if the reference count is zero, but it's quite subtle. Daniel