您的位置:首页 > 编程语言 > C语言/C++

C++ what operator can be overloaded?

2014-08-28 00:34 253 查看
One of the feature that C++ language provides is operator overloading. There are 5 operators that cannot be overloaded and others are overloadable.

In all the below operators, the below 7 operators are not overloadable.

1. Dot Operator .

2. Ternary Condition : ?

3. Scope Resolution ::

4. .* Operator

5. size of

6. typeid

7. All cast operators

All operators in C++

Assignment Operator =

Addition Operator +

Subtraction Operator -

Multiplication Operator *

Division Operator /

Unary Plus +

Unary Minus Operator -

Modulo Operator %

Increment Operator ++

Decrements Operator --

Equal To Operator ==

Not Equal To Operator !=

Greater Than Operator >

Less Than Operator <

Greater Than Or Equal To Operator >=

Less Than or Equal To Operator <=

Logical Not Operator !

Logical And Operator &&

Logical Or Operator ||

Bitwise Not ~a

Bitwise And &

Bitwise Or |

Bitwise Xor ^

Bitwise Left Shift <<

Bitwise Right Shift >>

Subscript Operator []

Indirection Operator * (object pointed by)

Reference Operator & (address of)

Deference Operator -> 

Dot Operator .

->* Operator

.* Operator

Comma Operator ,

Tenary Conditional Operator ? :

Scope Resolution Operator ::

Size Of Operator sizeof

Type ID Operator typeid

Conversion Operator

Overloading and Overiding

Stataic_cast

dynamic_cast

const_cast

reinterpret_cast

New Operator new

Delete Operator delete
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  C++ Programming