22 Sep
2021
22 Sep
'21
6:09 p.m.
rajesh daggumati wrote:
Hi Team, in my code,I had to write like below: const int* p = boost::get_error_infoboost::throw_line(exception); But while building the code,I am facing issue like below: error C2683: 'dynamic_cast':'boost::exception_ptr' is not a polymorphic type..
This implies that `exception` is of type `boost::exception_ptr`. This is not an exception type, it's an opaque pointer that refers to an exception. The only thing you can do with this pointer is tell it to rethrow the exception it refers to. So: try { boost::rethrow_exception( exception ); } catch( std::exception const& x ) { const int* p = boost::get_error_infoboost::throw_line(x); // use p here }