Content deleted Content added
Stevebroshar (talk | contribs) |
Stevebroshar (talk | contribs) →Arithmetic operators: less clever; easier to read |
||
Line 28:
|-
| {{rh}} colspan="2" | [[Addition]]
|
| {{cpp|1=R K::operator +(S b);}}
| {{cpp|1=R operator +(K a, S b);}}
|-
| {{rh}} colspan="2" | [[Subtraction]]
|
| {{cpp|1=R K::operator -(S b);}}
| {{cpp|1=R operator -(K a, S b);}}
|-
| {{rh}} colspan="2" | [[Unary operation|Unary]] plus; [[Type conversion#Type promotion|integer promotion]]
|
| {{cpp|1=R K::operator +();}}
| {{cpp|1=R operator +(K a);}}
|-
| {{rh}} colspan="2" | [[Unary operation|Unary]] minus; [[additive inverse]]
|
| {{cpp|1=R K::operator -();}}
| {{cpp|1=R operator -(K a);}}
|-
| {{rh}} colspan="2" | [[Multiplication]]
|
| {{cpp|1=R K::operator *(S b);}}
| {{cpp|1=R operator *(K a, S b);}}
|-
| {{rh}} colspan="2" | [[Division (mathematics)|Division]]
|
| {{cpp|1=R K::operator /(S b);}}
| {{cpp|1=R operator /(K a, S b);}}
|-
| {{rh}} colspan="2" | [[Modulo operation|Modulo]]<ref name="modulo" group="lower-alpha" />
|
| {{cpp|1=R K::operator %(S b);}}
| {{cpp|1=R operator %(K a, S b);}}
|-
|
▲| width="11%" align="center" | <code>'''++'''a</code>
▲| width="25%" | {{cpp|1=R& operator ++(K& a);}}
|-
| {{rh}}
|
| {{cpp|1=R K::operator ++(int);}} {{efn|name=dummy-int|The {{cpp|int}} is a dummy parameter to differentiate between prefix and postfix.}}
| {{cpp|1=R operator ++(K& a, int);}} {{efn|name=dummy-int}}
|-
| {{rh}} colspan="2
▲| style="text-align:center;" | <code>'''--'''a</code>
| {{cpp|1=R& K::operator --();}}
| {{cpp|1=R& operator --(K& a);}}
|-
| {{rh}}
|
| {{cpp|1=R K::operator --(int);}} {{efn|name=dummy-int}}
| {{cpp|1=R operator --(K& a, int);}} {{efn|name=dummy-int}}
|}
|