Boost logo

Boost :

From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2021-10-17 19:01:09


On Sun, Oct 17, 2021 at 9:21 AM rajesh daggumati via Boost <
boost_at_[hidden]> 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.


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