Boost logo

Boost Users :

Subject: [Boost-users] [exception] Passing existing exception hierarchies between threads
From: Szymon Gatner (szymon.gatner_at_[hidden])
Date: 2012-07-02 06:13:29


Hi,

I am trying to pass Poco::Exeption from worker thread to a client
thread/future. Idea is simple:

try
{
  operationThatMyThrowPocoException();
}
catch (const Poco::Exception& e)
{
  // rethrow with exception_ptr support so can be passed between threads
  BOOST_THROW_EXCEPTION(e);
}

but this causes compilation error because Poco::Exception defines
clone() method on its own:

error C2555: 'boost::exception_detail::clone_impl<T>::clone':
overriding virtual function return type differs and is not covariant
from 'Poco::Exception::clone' c:\devel\boost_1_50_0\boost\exception\exception.hpp 468

Is there a way to use BOOST_THROW_EXCEPTION /
enable_current_exception() with existing exception hierarchies that
define clone() already?

Regards,
Szymon

-- 
Szymon Gatner
The Lordz Games Studio
www.thelordzgamesstudio.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net