Nested lists std::vector<std::vector<int>> #4534
Unanswered
petrasvestartas
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Question
I am searching for "simple" equivalent to a
[[list0],[list1]...[listN]]
,std::vector<std::vector<int>>
.Does it mean that it is impossible to modify python list via CPP without create a custom container?
What is working is shown below.
And the problem is described in the last section.
CPP
On CPP side I have a vector and a nested vector:
Python - simple list:
Single list
[0, 2, 4]
needs to converted toWoodVectorInt
:Python - nested lists are not equivalent to CPP version - PROBLEM:
Nested lists are much more not straight-forward to write.
First I must create separate collections called
WoodVectorInt
and then add them to the the list:WoodNestedVectorInt([list_of_integers_0, list_of_integers_1, list_of_integers_2])
QUESTION Is it possible to have a nested python list e.g. [[0,1,2],[3,4,5],[6,7,8]] and directly cast it WoodNestedVectorInt ?
Beta Was this translation helpful? Give feedback.
All reactions