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
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
相关文章推荐
- It is said that wars in the 21st century will be fought over water. Do you agree? What do you think can be done now to alleviate
- Question 10: Given the following program snippet, what can we conclude about the use of dynamic_cast in C++?
- What can I learn right now in just 10 minutes that could be useful for the rest of my life?
- Win32 GDI - Practice (II) What can be called Closed Path?
- What can I learn right now in just 10 minutes that could be useful for the rest of my life?
- What you can change will be cheap ghd online
- Question 29: The C++ code below generates a compiler error. Which of the following solutions can be used to correctly access the
- What size can textures be?
- 【BCB】ocidl.h E2337 Only one of a set of overloaded functions can be ”C“ 报错解决办法
- How to design a class that can't be inherited(C++)
- Can namespaces be nested in C++?
- what energy function can be minimized by graph cuts
- Think about what can be improved, not what the problem is
- C++编译错误"a storage class can only be specified for objects and functions"解决
- 托福写作5-what is the most important characteristic that a person can have to be successful in life
- C++编译错误"a storage class can only be specified for objects and functions"解决方法
- How to design a class that can't be inherited(C++)
- 'static' can indeed be used in C++ to create a Static Member Function
- Can static functions be virtual in C++?
- What Operating Systems can be imaged with FOG?