Extra initializer/cleanup semantics
It would be nice to specify which members are deleted or uinitialzed:
class X
{
int* i;
int* j;
float* k;
void cleanInts() { delete i;delete j;}
~X(){delete k;cleanInts();}
};
in this case -sem(X::cleanInts,cleanup) won't help.
I propose the following semantics:
-sem(X::cleanInts,cleanup(X::i,X::j)) where cleanInts should free X::i and X::j
3
votes
J. van Hoorn
shared this idea