How can I make a wrapper function that calls another function with exactly the same name and parameters as the wrapper itself in the global namespace?
For example, I have Ah foo (int bar); and in A.cpp - its implementation, and in Bh foo (int bar); and in B.cpp foo (int bar) {foo (bar)}
I want B.cpp foo (bar) to call Ah foo (int bar), and not recursively.
How can i do this? I do not want to rename foo.
Update:
Ah is in the global namespace and I can't change it, so I assume that using namespaces is not an option?
Update:
Namespaces solve the problem. I did not know that you could call the global namespace function with :: foo ()
wrap-per
source
share