To help LDC/GDC

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Thu Apr 11 01:36:03 PDT 2013


On 04/10/2013 08:39 PM, Walter Bright wrote:
> Sure there is. Declare the function as pure, and the function's parameters as
> const or immutable.

Sure, I accept that.  What I was meaning, though, was an up-front declaration
which would make the compiler shout if those necessary conditions were not met.

i.e.

       pure foo(int n) { ... }     // compiles

       strong pure bar(int n) { ... } // compiler instructs you to make
                                      // variables const or immutable


More information about the Digitalmars-d mailing list