How do I create an array in Cpp2 which is on the heap instead of the stack? #743
Answered
by
hsutter
jituderaps
asked this question in
Q&A
|
Answered by
hsutter
Oct 20, 2023
Replies: 3 comments 2 replies
|
This happens to work (https://cpp2.godbolt.org/z/8ehdn71W5): Because #628 (comment) and #628 (comment) aren't implemented yet. |
1 reply
|
This works, somewhat it terminates on out of bounds access too. But idk how to initialise the elements |
1 reply
Answer selected by
jituderaps
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See #740, and this is now addressed with commit e6a1cc3 .
You can write:
pi := new<std::array<int, 5>>(1, 2, 3, 4, 5);