I have stateful class, once a class instance is created, its Bar function/method can only be called once otherwise the internal state will mess up. How to design such thing?
Something can warn/error at compile time would be better.
class Foo {
bool Bar(string arg...) { do something...}
// some class member
string s;
int i;
}
Aucun commentaire:
Enregistrer un commentaire