C++ Tips: Operators


Table of Contents


Binary operators with derived classes
Efficienctly implementing operator +
Temporaries and internal data
Constructors and operator = are very similar
Virtual operator =
Consistency for operator = and copy constructors
The first argument to overloaded operators
Type promotions and global operators
Virtualness and operator =
Operator new and delete for arrays
Overloading operator and others
Example usage of comma operator
Yet another assignment operator
L-values and operators
Overloading resolution with built-in operators
Increment operator and lvalues
Assignment is not initialization
Lvalues/rvalues with prefix/postfix ++/-- operators
Suppressing operator =
Problems with "placement" form of operator =
Assignment operator considerations
Is global operator & allowable?
Why is operator = required to be a member?
Use for operator comma ?
Rationale for operator overloading
Overloading operator , ?
Why operator [] must be a member function
operator equivalents
The Principle of Least Astonishment
virtual assignment and derivation
assignment and classes with references
virtual operator ==
canonical form for operator ++ prefix and postfix
operator and const operator ambiguity
conversion operators and single arg constructors
the copy-assignment operator
why no "inheritance" of assignment operator
operator ->
operator ++ and lvalues
efficiency of operator+()
philosophy of using conversion operators
compiler-generated assignment operators
assignment via destruction and construction
designing operator ==
argument for return type of operator =
object identity and self assignment tests
global operators versus member operators
copy constructor and assignment basics
overloading of operators
return type of operator ->
unary plus operator
evaluating &*e

This site was grabbed using the TRIAL version of Grab-a-Site. This message does not appear on a licensed copy of Grab-a-Site.