There is overloading functions and overloading operators. Overloading functions is giving two functions the same name, but having the input parameters be different. For example:
Code:
void DisplayData(int integerData)
{
cout << integerData << endl;
}
void DisplayData(float floatData)
{
cout << floatData << endl;
}
I think what you want is operator overloading. This allows you to give a new definition to an operator (like | or & or * or + or =, etc.) based on what types are used with the operator. Usually, this is used for a specific class. So if you have a class that represents a set, you could overload the operator | to combine two instances of the set. Do you already have a class that represents a set? That would be a good start.