Rules and why c++ does not allow overloading to return only functions with different types.
overloading means that the function signatures are different. The function signatures include: function name, parameter type and order of parameters, but not the return type. Therefore, if only the return type is different, two functions with the same signature will be considered as the same function by the C++ standard, and an error will be reported during compilation, and the function cannot be resolved.