-
When I write a for in loop using a DynamicVector, when I use the loop variable representing the element, it generates an error similar to:
The loop variable is a reference rather than the value. Is this correct? How can I get access to the value rather than the reference? var dv = DynamicVector[Int8]()
dv.append(1)
dv.append(2)
for b in dv:
print(b.to_int()) Indexing the DynamicVector works fine: for i in range(len(dv)):
print(dv[i].to_int()) |
Beta Was this translation helpful? Give feedback.
Answered by
soraros
Mar 28, 2024
Replies: 1 comment
-
You can deref by using |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jolonf
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can deref by using
b[]
.