DIP60: @nogc attribute

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Fri Apr 25 08:32:40 PDT 2014


On Fri, 25 Apr 2014 11:29:37 -0400, Steven Schveighoffer  
<schveiguy at yahoo.com> wrote:

> On Fri, 25 Apr 2014 11:12:54 -0400, Dicebot <public at dicebot.lv> wrote:
>
>> On Friday, 25 April 2014 at 14:01:07 UTC, Steven Schveighoffer wrote:
>>> But what really is the difference between a function that is marked as  
>>> @nogc that compiles on compiler X but not compiler Y, and some custom  
>>> attribute that compiles on X but not Y?
>>
>> There are no user-defined attributes that can possibly fail on only  
>> some compiler. And compiler-specific attributes are part of that  
>> compiler documentation and never part of language spec. This is the  
>> difference.
>
> But such a situation would not violate a spec that says "@nogc means  
> there are no hidden GC calls." And the end result is identical -- I must  
> compile function foo on compiler X only.

You know what, in fact, @nogc may need to be re-branded as  
compiler-specific.

-Steve


More information about the Digitalmars-d mailing list