function overloading in C++

The rules:
* Overloaded functions MUST change the argument list. Arguments should be different type, different number, or different sequence.
    * Parameter declarations that differ only in a pointer * versus an array [] are equivalent. That is, the array declaration is adjusted to become a pointer declaration. Only the second and subsequent array dimensions are significant in parameter types.
    * Parameter declarations that differ only in that one is a function type and the other is a pointer to the same function type are equivalent. void h(int ()); is the same as void h(int (*)()); 
    * Parameter declarations that differ only in the presence or absence of const and/or volatile are equivalent. That is, the const and volatile type-specifiers for each parameter type are ignored when determining which function is being declared, defined, or called.
    * Only the const and volatile type-specifiers at the outermost level of the parameter type specification are ignored in this fashion; const and volatile type-specifiers buried within a parameter type specification are significant and can be used to distinguish overloaded function declarations. In particular, for any type T, “pointer to T,” “pointer to const T,” and “pointer to volatile T” are considered distinct parameter types, as are “reference to T,” “reference to const T,” and “reference to volatile T.”
* Overloaded functions CAN change the return type.
* Overloaded member functions CAN change the access modifier.
* A member function CANNOT be overloaded in a subclass. Member function in superclass will be hidden, but can be accessed using scope operator.
* You can overload functions across namespaces. 
* C++ allows methods to be overloaded on the basis of const type. Overloading on the basis of const type can be useful when a function returns a reference or pointer. We can make one function const, that returns a const reference or const pointer, and another non-const function, that returns a non-const reference or pointer.
* C++ allows methods to be overloaded on the basis of volatile type. 

How does Function Overloading work?
* Exact match (function name and parameter)
* If a not exact match is found:
    * Char, unsigned char, and short are promoted to an int.
    * Float is promoted to double
* If no match is found:
    * C++ tries to find a match through the standard conversion.
```
#include <iostream>
using namespace std;

class B {
public:
    void add(int a, int b) {
      cout << "B::sum = " << (a + b) << endl;
    }
};

class D: public B {
public:
    void add(float a, float b) {
        cout << "D::sum = " << (a + b) << endl;
    }
};

int main()
{
    D d;
    d.add(10, 2); // D::sum = 12
    d.B::add(10, 2); // B::sum = 12
    
    return 0;
}
```