Fully transitive const is not necessary

Janice Caron caron800 at googlemail.com
Tue Apr 1 12:04:14 PDT 2008


On 01/04/2008, Bill Baxter <dnewsgroup at billbaxter.com> wrote:
>    // Hypothetical pure function with implicit/deduced constness
>    pure int foo(Klass a) {
>       scope b = new Klass;
>       Klass[] x;
>       x ~= a;
>       x ~= b;
>       random_shuffle(x);
>       x[0].prop = 10;  // is this ok or not?
>    }

Just for the record, random_shuffle() is not a pure function, and
hence cannot be called from within a pure function.



More information about the Digitalmars-d mailing list