I have some C++ code that is automatically generated to wrap some C code.
The C code has a predictable structure with the exception that it has/has not a certain function.
Since the C++ code is derived from a description that does not have this information. I would like to use the template processor to decide if this function can be called.
small example:
struct SomeStruct{
int indicatorMember;
};
extern "C" void someFun(struct SomeStruct* somePointer){
}
void someCPPcode(){
SomeStruct s;
// do something
someMechanismToCall_someFunIfExists(&s);
// do something other
}
How does someMechanismToCall_someFunIfExists
have to look like, so that someCPPcode can be compiled/run in cases there someFun
does exist and if it does not exist?
Is this even possible?
It would also be possible to decide if this function exists, if a certain member is part of a structure.
so, if indicatorMember
does exist, the function also exists.