17 Oct
2021
17 Oct
'21
7:01 p.m.
On Sun, Oct 17, 2021 at 9:21 AM rajesh daggumati via Boost < boost@lists.boost.org> wrote:
My application code was handled with shared_pointers. here boost::rethrow_exception is throwing exception object (which is created in stack..) but shared pointers need objects which are created on heap SO for that , I am converting object from stack to heap by copying it.(ie. classname *c1 = new classname(stack_object)).
It looks like you should use std::current_exception and holding exceptions in std::exception_ptr rather than std::shared_ptr. If using an old compiler that does not support these, Boost provides compatible alternatives.