nothrow by default

Johannes Pfau nospam at example.com
Thu Jan 9 22:39:25 UTC 2020


Am Thu, 09 Jan 2020 21:35:51 +0000 schrieb Ola Fosheim Grøstad:

> On Thursday, 9 January 2020 at 21:29:00 UTC, Johannes Pfau wrote:
>> As far as I understood Sutter's proposal it's one word of 'context'.
>> But a function actually returns two words (i.e. two words of state),
>> where one is the error category and the second
> 
> Well, on x86 a register can be 256 bits or more... But AFAIK C++
> implementations do not allocate memory for exceptions dynamically. So
> you only pay the price of the constructor and potential cache miss.


I don't know the details, but I guess that's the throw by value / catch 
by reference idiom in C++. Not sure how it's actually implemented.

In addition to constructor + cache miss you'll also have to do RTTI to 
match the object to the types in the catch handlers (and for the 
downcast).


-- 
Johannes


More information about the Digitalmars-d mailing list