Skip to content
Prev Previous commit
Next Next commit
add example in specs
  • Loading branch information
jvdp1 committed Jun 22, 2022
commit 88e6f36b740b719cc61d5c0608bccb622c3d9a91
26 changes: 10 additions & 16 deletions doc/specs/stdlib_hashmaps.md
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ exists] )`

Subroutine.

##### Argument
##### Arguments

`other`: shall be a scalar expression of type `other_type`. It
is an `intent(in)` argument.
Expand Down Expand Up @@ -644,26 +644,20 @@ other_type are of the same type. Otherwise, `exists` is `.false.`
##### Example

```fortran
program demo_get
program demo_get_other_scalar
use stdlib_hashmap_wrappers, only: &
get, key_type, set
use iso_fortran_env, only: int8
get_other_scalar, other_type, set
use stdlib_kinds, only: int32
implicit none
integer(int8), allocatable :: value(:), result(:)
type(key_type) :: key
integer(int_8) :: i
allocate( value(1:15) )
do i=1, 15
value(i) = i
end do
call set( key, value )
call get( key, result )
print *, 'RESULT == VALUE = ', all( value == result )
integer(int32) :: value, result
type(other_type) :: other
value = 15
call set( other, value )
call get_other_scalar( other, result )
print *, 'RESULT == VALUE = ', ( value == result )
end program demo_get
```



#### `hasher_fun`- serves aa a function prototype.

##### Status
Expand Down