Hi, I'm having some trouble overloading methods in C++. As an example of the problem, I have a class with a number of methods being overloaded, and each method having one parameter with a different data type. My question: is there a particular order in the class these methods should appear in, to make sure the correct method is called depending on its parameters data type?
class SomeClass{
public:
...
void Method(bool paramater);
void Method(std::string paramater);
void Method(uint64_t paramater);
void Method(int64_t paramater);
void Method(uint8_t paramater);
void Method(int8_t paramater);
void Method(float paramater);
void Method(double paramater);
void Method(ClassXYZ paramater);
}
I noticed there was problem because when running:
Method("string");
it was calling:
Method(bool paramater);