I have a class where I am deliberately naming some of the member functions with the same name as common math library functions such as
, but using different types such as
Keeping the names identical between the math library and the class I'm writing is essential for a macro I'm using.
My problem is that inside my member functions I want to call on the math library functions, but the compiler seems to only look in the namespace of the class. I say namespace loosely because I mean in the class space even though I didn't create a namespace otherwise.
For example, if my class were called
, then here is an example to illustrate my problem:
string myclass::log(string in)
double outD=log(inD); // At this point the compiler has an issue:
// It can't seem to find the math library.
// It says:
//"error: no suitable conversion function
//from "std::string" to "double" exists
I can get around this by adding:
extern double log(double);
but I don't think I should have to.
Is there a way to say "not using namespace myclass?"