Notation in Expressions

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

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* consttype* volatiletype* volatile const

const type

typeconst typeconst type&

volatile type

typevolatile typevolatile 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.

See Also

Reference

Semantics of Expressions