[exception] Lifetime of exception refered to by exception_ptr

I failed to find in Boost.Exception documentation any note on how long is the lifetime of an exception object referred to by an exception_ptr. Also I failed to find it in the referred N2179 (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html). It seems logical to assume that the lifetime is not shorter then the lifetime of any exception_ptr object referring to the exception object. N2179 suggests possibility of use of smart pointer as implementation of exception_ptr which makes that assumption even more justified. However I think that documentation should be explicit with this. Adam Badura

Adam Badura:
I failed to find in Boost.Exception documentation any note on how long is the lifetime of an exception object referred to by an exception_ptr. Also I failed to find it in the referred N2179 (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html).
It seems logical to assume that the lifetime is not shorter then the lifetime of any exception_ptr object referring to the exception object. N2179 suggests possibility of use of smart pointer as implementation of exception_ptr which makes that assumption even more justified.
The authoritative reference for exception_ptr is now the C++0x standard draft http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2857.pdf which states in 18.8.5/7: "The referenced object shall remain valid at least as long as there is an exception_ptr object that refers to it."

The authoritative reference for exception_ptr is now the C++0x standard draft
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2857.pdf
Then maybe Boost.Exception documentation should refer to that document instead of N2179 (to which it refers in the Contents [twice, http://www.boost.org/doc/libs/1_39_0/libs/exception/doc/boost-exception.html] and Tutorial [http://www.boost.org/doc/libs/1_39_0/libs/exception/doc/tutorial_exception_ptr.html])? Adam Badura

On Wed, May 13, 2009 at 9:16 AM, Adam Badura <abadura@o2.pl> wrote:
I failed to find in Boost.Exception documentation any note on how long is the lifetime of an exception object referred to by an exception_ptr. Also I failed to find it in the referred N2179 (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html).
It seems logical to assume that the lifetime is not shorter then the lifetime of any exception_ptr object referring to the exception object. N2179 suggests possibility of use of smart pointer as implementation of exception_ptr which makes that assumption even more justified.
However I think that documentation should be explicit with this.
Fixed. Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode
participants (3)
-
Adam Badura
-
Emil Dotchevski
-
Peter Dimov