Notation in Expressions

The C++ language specifies certain compatibilities when specifying operands. Table 4.5 shows the types of operands acceptable to operators that require operands of type type.

Table 4.5   Operand Types Acceptable to Operators

Type Expected Types Allowed
type const type
volatile type
type&
const type&
volatile type&
volatile const type
volatile const type&
type* type* const
type* volatile
type* volatile const
const type type
const type
const type&
volatile type type
volatile type
volatile type&

Because the preceding rules can always be used in combination, a const pointer to a volatile object can be supplied where a pointer is expected.