Conversion from exception_ptr to shared_ptr

rajesh daggumati via Boost-users <[email protected]>
Newsgroups gmane.comp.lib.boost.user
Message-ID <CAAfjeaZSzn7_unt92k9WZpAvv7HCdXp0+O0GSg8BNcbXH-98sQ@mail.gmail.com>
HI,
please help me to solve below issue.
Shared pointers are used in my code.

class Exception : public virtual std::exception,public virtual
boost::exception
{
   ---
};
class ExceptionTestException : public Exception
{
---
};
boost::shared_ptr<Exception> exceptionptr_t;




try
{
 Boost_Throw_function(ExceptionTestException("Hiii"));
}
catch(...)
{
    boost::exception_ptr  exceptionptr = boost::current_exception();
   try
  {
       boost::rethrow(exceptionptr)
  }
 catch(boost::exception &e)
  {
    //here i need to assign this 'e' to shared pointer but this e is not in
heap so then how to assign this e to sharedptr(exceptionptr_t).
    1 way is :
       boost::exception *ep = new ExceptionTestException(e);
     exceptionptr_t(ep);
       here we know that exception_ptr is having ExceptionTestException but
in some cases, we dont know which type of excepiton we have in
exception_ptr in         runtime.
then how to assign to shared_ptr

_______________________________________________
Boost-users mailing list
[email protected]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.