Constant operations

Constant operations cannot change the data on which they operate.

The me parameter of a constant operation points to a structure that is tagged as const. In this case, the const keyword comes before the data type specifier in the argument list. For example, the following sample is the generated code of a constant operation called check() that can access, but not change, the contents of B:


void B_check(const B* const me) {
    /*#[ operation check() */
    /*#]*/
}