//ClassA.h
Class ClassA
{
private:
UtilityClass utilityCls; // this is the instance that I need to access
virtual void Read();
static bool IsValid(char c);
}
//ClassA.cpp
void ClassA::Read()
{
....
string str = "abcdefg"; // sample only
if(find_if(str.begin(), str.end(), IsValid) == str.end())
{
....
}
}
inline bool IsValid(char c)
{
// There are compile errors When I call functions of Utility class here
// Ex: utilityCls.ProcessData();
return (isalpha(c)); // sample only
}
I really need to access "utilityCls" inside the "IsValid" function. Is there a simple way to do this? Or are there any other way or workaround? Sorry if this is a stupid question. Please help me guys...