mercredi 2 décembre 2015

How to force to call a couple of functions in sequence?

I have a class with two functions foo1 and foo2 that must be called in sequence: foo1, foo2.

How to force the user to call foo2 every time he has already called foo1?

Is it possible to check this sequence at compile time?

I'm working with Visual Studio 2010, so I can't use c++11. I can't use boost libraries because I'm working in a real time environment and my boss wants to avoid it.

Thanks

Aucun commentaire:

Enregistrer un commentaire