可重载运算符和不可重载运算符

 

可重载运算符表:

Opp

Name

Type

  Opp

Name

Type

,

Comma

Binary

–>*

Pointer-to-member selection

Binary

!

Logical NOT

Unary

/

Division

Binary

!=

Inequality

Binary

/=

Division/assignment

Binary

%

Modulus

Binary

< 

Less than

Binary

%=

Modulus/assignment

Binary

<< 

Left shift

Binary

&

Bitwise AND

Binary

<<=

Left shift/assignment

Binary

&

Address-of

Unary

<=

Less than or equal to

Binary

&&

Logical AND

Binary

=

Assignment

Binary

&=

Bitwise AND/assign

Binary

==

Equality

Binary

( )

Function call

> 

Greater than

Binary

*

Multiplication

Binary

>=

Greater than or equal to

Binary

*

Pointer dereference

Unary

>> 

Right shift

Binary

*=

Multiplication/assign

Binary

 >>=

Right shift/assignment

Binary

+

Addition

Binary

[ ]

Array subscript

+

Unary Plus

Unary

^

Exclusive OR

Binary

++

Increment1

Unary

^=

Exclusive OR/assignment

Binary

+=

Addition/assignment

Binary

|

Bitwise inclusive OR

Binary

Subtraction

Binary

|=

Bitwise inclusive OR/assignment

Binary

Unary negation

Unary

  ||

Logical OR

Binary

––

Decrement1

Unary

   ~

One’s complement

Unary

–=

Subtraction/assign

Binary

 delete

 delete

–>

Member selection

Binary

 new

 

 

 

不可重载运算符表:

 

Operator

Name

.

Member selection

.*

Pointer-to-member selection

::

Scope resolution

? :

Conditional

#

Preprocessor symbol

##

Preprocessor symbol

 

 

 

你可能感兴趣的:(可重载运算符和不可重载运算符)