Logical const

Peter Alexander peter.alexander.au at gmail.com
Tue Nov 30 01:17:50 PST 2010


On 30/11/10 2:00 AM, Walter Bright wrote:
> Logical const means the same value is returned every time, not a
> different one.

No, it doesn't. Not even D's const can guarantee that:

struct Foo
{
   int foo() const { return random(); }
}


pure is related to const, but they are not the same thing.


More information about the Digitalmars-d mailing list