[cpp-threads] Issue 1369 --- thread safety of std::rethrow_exception
Anthony Williams
anthony at justsoftwaresolutions.co.uk
Tue Nov 16 08:50:58 GMT 2010
On 16/11/10 08:34, N.M. Maclaren wrote:
> On Nov 16 2010, Anthony Williams wrote:
>>
>> In order to clone exceptions you need two things: the size of the
>> object to clone (so you can allocate space for the new one), and the
>> ability to call the copy constructor so you can actually do the copy.
>
> You also need the constraint that all exceptions HAVE a copy constructor,
> with the usual semantics. I don't see that in the existing standard.
15.1p3 of the FCD says:
"... Except for these restrictions and the restrictions
on type matching mentioned in 15.3, the operand of throw is treated
exactly as a function argument in a
call (5.2.2) or the operand of a return statement."
and p5 says:
"When the thrown object is a class object, the copy/move constructor and
the destructor shall be accessible,
even if the copy/move operation is elided (12.8)."
Hmm. In C++03, exceptions had to be copyable. It looks like in C++0x
they can be move-only. Was this deliberate?
Anthony
--
Author of C++ Concurrency in Action http://www.stdthread.co.uk/book/
just::thread C++0x thread library http://www.stdthread.co.uk
Just Software Solutions Ltd http://www.justsoftwaresolutions.co.uk
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976
More information about the cpp-threads
mailing list