Content deleted Content added
Stevebroshar (talk | contribs) Info that was illogically/incorrectly under evaluation order is moved to intro as it's pretty high-level info |
Voltaic181 (talk | contribs) m →Relational: Fixed table spanning incorrectly. |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 69:
| {{rh}} colspan="2" | Postfix increment
| align="center" | <code>a'''++'''</code>
| {{cpp|1=R K::operator ++(int);}}
| {{cpp|1=R operator ++(K& a, int);}}
|-
| {{rh}} colspan="2" | Prefix [[Increment and decrement operators|decrement]]
Line 79:
| {{rh}} colspan="2" | Postfix decrement
| align="center" | <code>a'''--'''</code>
| {{cpp|1=R K::operator --(int);}}
| {{cpp|1=R operator --(K& a, int);}}
|}
Line 128:
|-
| {{rh}} colspan="2" | [[Three-way comparison]]<ref name="threewaycomparison" group="lower-alpha"/>{{efn|Possible return types: <code>std::weak_ordering</code>, <code>std::strong_ordering</code> and <code>std::partial_ordering</code> to which they all are convertible to.}}
|
| {{cpp|1=auto K::operator <=>(const S &b);}}
| {{cpp|1=auto operator <=>(const K &a, const S &b);}}
Line 175:
! outside class
|-
| {{rh}} colspan="2" | [[Bitwise operation#NOT|
| align="center" | <code>'''~'''a</code><br/>
| {{cpp|1=R K::operator ~();}}
| {{cpp|1=R operator ~(K a);}}
|-
| {{rh}} colspan="2" | [[Bitwise operation#AND|
| style="text-align:center;" | <code>a '''&''' b</code>
| {{cpp|1=R K::operator &(S b);}}
| {{cpp|1=R operator &(K a, S b);}}
|-
| {{rh}} colspan="2" | [[Bitwise operation#OR|
| style="text-align:center;" | <code>a '''<nowiki>|</nowiki>''' b</code>
| {{cpp|1=R K::operator {{!}}(S b);|lang=cpp}}
| {{cpp|1=R operator {{!}}(K a, S b);|lang=cpp}}
|-
| {{rh}} colspan="2" | [[Bitwise operation#XOR|
| style="text-align:center;" | <code>a '''^''' b</code>
| {{cpp|1=R K::operator ^(S b);}}
| {{cpp|1=R operator ^(K a, S b);}}
|-
| {{rh}} colspan="2" | [[Bitwise shift|
| style="text-align:center;" | <code>a '''<<''' b</code>
| {{cpp|1=R K::operator <<(S b);}}
| {{cpp|1=R operator <<(K a, S b);}}
|-
| {{rh}} colspan="2" |
| style="text-align:center;" | <code>a '''>>''' b</code>
| {{cpp|1=R K::operator >>(S b);}}
Line 210:
C and C++ have the same assignment operators and all can be overloaded in C++.
For the combination operators, <code>a ⊚= b</code> (where <code>⊚</code>
{| class="wikitable" style="width:100%"
Line 384:
| {{n/a}}
|-
| {{rh}} colspan="2" | [[type conversion|Conversion]]
| style="text-align:center;" | <code>R(a)</code><br><code>R{a}</code><ref name="sinceCXX11" group="lower-alpha" /><br><code>auto(a)</code><ref name="sinceCXX23" group="lower-alpha" /><br><code>auto{a}</code><ref name="sinceCXX23" group="lower-alpha" /> || {{no}} || {{no}}
| {{rh}} colspan="2" {{n/a}}
|-
| {{rh}} colspan="2" | [[static_cast]] conversion
| style="text-align:center;" | <code>'''static_cast'''<R>(a)</code> || {{yes}} || {{no}}
| {{cpp|1=K::operator R();}}<br>{{cpp|1=explicit K::operator R();}}<ref name="sinceCXX11" group="lower-alpha" />
|