Next: 4 Complexity  Up: 3 Class  Previous: 3.4 Object Oriented Design  Contents

3.5 Operator Overloading

3.5.1

High Integrity CPP Rule

Avoid overloading the comma operator (','), operator AND ('&&'), and operator OR ('||').

3.5.2

High Integrity CPP Rule

Always write operations, that are normally equivalent, to be equivalent when overloaded.

3.5.3

High Integrity CPP Rule

Ensure that overloaded binary operators have expected behaviour.

3.5.4

High Integrity CPP Rule

Make binary operators non-members to allow implicit conversions of the left hand operand.

3.5.5

High Integrity CPP Guideline

When overloading the subscript operator ('operator[]') implement both const and non-const versions.


HICPP VERSION 2.4  http://www.codingstandard.com   Copyright: © 2007 THE PROGRAMMING RESEARCH GROUP