National-instruments AutoCode NI MATRIX Bedienungsanleitung Seite 99

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 250
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 98
Chapter 3 Ada Language Reference
© National Instruments Corporation 3-37 AutoCode Reference
Example 3-6 Example Code Causing Ambiguous Selection of Overloaded Operators
function "*" (left:SB0; right:SB1) return SL0;
function "*" (left:SB0; right:SB1) return SS0;
function "*" (left:SL0; right:SL0) return SL0;
function "*" (left:SS0; right:SL0) return SL0;
function TO_SLO (left:SL0) return SL0;
V1 : SB0; V2 : SB1: VL:SL0;
begin
VL := V1 * V2 * VL --ambiguous
VL := TO_SL0(V1 * V2) * VL; --unambiguous expression
end;
The first assignment is ambiguous because there is more than one choice of
the overloaded operator function that would satisfy the first multiplication
subexpression. The second assignment is not ambiguous because the
TO_SLO function is unary and not overloaded. Therefore, the unary
function is forcing the
V1*V2 subexpression to return a SL0 result. Thus,
there is only one operator that satisfies the second example.
Seitenansicht 98
1 2 ... 94 95 96 97 98 99 100 101 102 103 104 ... 249 250

Kommentare zu diesen Handbüchern

Keine Kommentare