I just got it! (invariant/const)

Bill Baxter dnewsgroup at billbaxter.com
Wed Apr 9 09:38:46 PDT 2008


guslay wrote:
> Janice Caron Wrote:
> 
>> On 09/04/2008, Georg Wrede <georg at nospam.org> wrote:
>>
>>     int f(invariant D d) invariant pure { ... } 
> 
> Shouldn't it be
> 
> int f(invariant D d) pure { ... } 
> 
> Pure functions are a subset of invariant functions, no?

Just a nitpick, but "pure" applies to the function as a whole.  So 
there's no reason not to put it at the head with 'static' and protection 
levels.  There's no 'pure int'.  It's not going to be a type 
constructor.  Just a storage class.  AFAIK.

--bb



More information about the Digitalmars-d mailing list