Skip to content

Commit 4ee5dd0

Browse files
committed
Add demo of in-place array construction
1 parent 9b67679 commit 4ee5dd0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/test_vector.F90

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ subroutine test_int4()
7373
element_ptr = 1234
7474
ASSERT(v2%get(2) == 1234)
7575
call v2%release()
76+
77+
! Create from an in-place array
78+
v = Vector([integer(4) :: 1, 2, 3, 5, 8, 13])
79+
ASSERT(v%size() == 6)
80+
ASSERT(v%get(1) == 1)
81+
ASSERT(v%back() == 13)
82+
call v%release()
7683
end subroutine
7784

7885
!-----------------------------------------------------------------------------!

0 commit comments

Comments
 (0)