\"\" \"\" \"\"
Go backward to Representation
Go up to Pointers
Go forward to Allocation
RISC-Linz logo

Definition

Pointer<T> p
Pointer<T> p(1)

Specification: Defines a pointer p.

  1. In the first form, p may refer to any object of type T. p does not yet refer to any object.
  2. In the second form, p is bound to a new memory block that may hold any T object. The memory block does not yet hold any T object.
Constraint: It is syntactically possible but illegal to define for n != 0
Pointer<T> p(n)
Note: The second form is equivalent to 
Pointer<T> p
p.alloc()
which is in turn equivalent to but more efficient than 
Pointer<T> p
p = Pointer<T>::Alloc()

Author: Wolfgang Schreiner
Last Modification: April 12, 1997