Most basic nothrow, pure, @safe functions?

Steven Schveighoffer schveiguy at yahoo.com
Wed Mar 19 10:12:26 PDT 2014


On Tue, 18 Mar 2014 21:56:54 -0400, Mike Parker <aldacron at gmail.com> wrote:

> On 3/19/2014 8:20 AM, Steven Schveighoffer wrote:
>
>> We all agreed that nothing that assumeSafeAppend did should really
>> throw, and so the pull just used c linkage to "add" nothrow to an
>> otherwise unmarked function.
>
> Does this mean that extern(C) functions are automatically considered  
> nothrow? That is not my current understanding.

No, but extern C functions are not mangled. Therefore, the declaration can  
be nothrow, but the implementation not have that attribute, and linking  
still works. It's a way to work around the compiler checks.

-Steve


More information about the Digitalmars-d mailing list