Michal Minich wrote:
Hello Denis,

OTOH, if you want to protect yourself from (accidental) global state
mutation, you are free to declare your static function as pure:

struct X
{
static int x;
static void foo() pure
{
// x = 3; // error
}
static void bar()
{
x = 3; // okay
}
}

I was thinking about providing contract to function, that it does not *modify* state, something as half-pure. Anyway, this would be hard to define correctly.

That's what gcc calls "__attribute__((pure))" (they use "__attribute__((const))" for what D calls "pure")

                Jerome
--
mailto:[email protected]
http://jeberger.free.fr
Jabber: [email protected]

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to