assume I have the following function
int watchVar(const char* var, const char* descriptor,
Color (*colorfunc)(const char* var) = yellowColorFunc)
with
Color yellowColorFunc(const void* var){
return Color::yellow();
}
I want to overload watchVar to accept functions whos parameters are char, int, float, etc, but do not want to create a default color function for each type.
g++ gives this error:
xpcc::glcd::Color (*)(const char*)' has type 'xpcc::glcd::Color(const void*)
Is there another way besides declaring colorfunc to take a void pointer and forcing the caller to cast the argument later himself?
Thanks
xpcc::glcd::Color (*)(const char*)' has type 'xpcc::glcd::Color(const void*)