recursive subroutine add_item(this, new_stuff)
class(vector_ref),intent(inout) :: this
class(*), target, intent(in) :: new_stuff
if(this%get_verbose()) print *, 'vector_ref%add_item begin'
if(this%current_size == this%maximum_size) then
call this%extend()
end if
this%current_size = this%current_size + 1
this%items(this%current_size)%stuff => new_stuff
if(this%verbose) then
print *, 'added to vector_ref (', this%current_size, '/', &
this%maximum_size, ' elements)'
end if
if(this%get_verbose()) print *, 'vector_ref%add_item end'
end subroutine add_item