Subprograms which have the same name but different behaviour are declared as usual. This applies to both procedures and functions. According to the following criteria it has to be possible to choose exactly one procedure or function (resolution of overloading):
Names of arguments (in case of an argument transfer by explicitly naming it "named association", [=> see Examples])
If in a function call several variants are valid the local variant (e.g., in the architecture`s declarative part) hides the variant which ranks higher in hierarchy (e.g., from a package). By giving the complete subprogram name and hierarchy one still access any desired variant (Qualified Expression).
Operators are different from simple functions in two ways:
The name or the symbol of an operator is not a normal designator but a string and therefore in declaration it stands in inverted commas.
In a common operator call the operands are placed before or after the operator (unary operators only afterwards) and not in round brackets placed after the operator. However, it is also possible to call operators with the syntax of normal function calls (=>see Examples).
It is important to consider the handling of operators as strings when declaring overloaded operators. Apart from that the overloading of operators is not different from that of functions and procedures.
In these examples only the declarations and calls of the overloaded subprograms are shown. Of course a subprogram definition has to be written for every declaration.