What is nothrow for?

Janice Caron caron800 at googlemail.com
Fri Apr 25 13:57:52 PDT 2008


On 25/04/2008, Yigal Chripun <yigal100 at gmail.com> wrote:
> if I understand you correctly, you want

No, I was merely postulating. It's not something I want, it was merely
an example of something the compiler could do that a library add-on
couldn't.

>  I'm not sure how the compiler can verify that at all due to polymorphism
>  - the dynamic type of the instance will be known only at run-time.

Who cares? If I'm going to invent an arbitrary attribute, I can define
it to do anything I want. Besides, structs have a "this", but not
polymorphism, so the compiler could certainly check in the case of
structs.

To give an even sillier example, a compiler could introduce a function
attribute that meant "this function will not modify any variable
starting with the letter x". I don't see how an add-on could do that
through hooks.



More information about the Digitalmars-d mailing list