add_item Subroutine
private recursive subroutine add_item(this, new_stuff)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector), | intent(inout) | :: | this | |||
class(*), | intent(in), | target | :: | new_stuff |
Variables
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
class(*), | public, | pointer | :: | my_stuff |
Source Code
recursive subroutine add_item(this, new_stuff)
class(vector),intent(inout) :: this
class(*), target, intent(in) :: new_stuff
class(*), pointer :: my_stuff
if(this%get_verbose()) print *, 'vector%add_item begin'
allocate(my_stuff, source=new_stuff)
call this%vector_ref%add(my_stuff)
if(this%get_verbose()) then
print *, 'added to vector (', this%length(), '/', &
this%capacity(), ' elements)'
end if
if(this%get_verbose()) print *, 'vector%add_item end'
end subroutine add_item