What is a good technique to determine if a function was called in C++ without setting a global variable?
#include <iostream>
bool var = false;
void X ()
{
if (var) {std::cout<<" Y called "<< std::endl;}
}
void Y ()
{var = true;}
int main()
{
Y();
X();
}
I would really like an example of a way to do this without setting a global variable.
Aucun commentaire:
Enregistrer un commentaire