[cpp-threads] Issue 1369 --- thread safety of std::rethrow_exception

Anthony Williams anthony at justsoftwaresolutions.co.uk
Tue Nov 16 09:45:32 GMT 2010


On 16/11/10 09:30, N.M. Maclaren wrote:
> On Nov 16 2010, Anthony Williams wrote:
>> 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?
>
> That's the thrown object and NOT the exception object - the reason that
> the thrown object has to be moveable is because it is copied/moved into
> the exception object. All of the handling of the actual exception object
> is done entirely by the implementation (see paragraphs 3 and 4).

I'm only talking about the thrown object! I really don't care about the 
"exception object" which is used by the runtime, just the copy of the 
C++ object that got thrown. In this whole discussion this is what I've 
been referring to by "exception".

You've misunderstood my question. C++03 requires thrown objects to be 
copyable. Was it a deliberate decision on the part of WG21 to allow 
thrown objects to be move-only, or was this an accidental consequence of 
adding rvalue reference support?

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