Skip to content

How do I access elements of map of maps and map of maps of sets? #511

Answered by kasperl
paddyrg asked this question in Q&A
Discussion options

You must be logged in to vote

The typical approach is using the [] operator if you know the data is there:

x[2]["sensors"][0] = 3

The example is a little bit confusing, because you're using sets like {0,0,0,0} with many equal entries, so in reality such a set will only have one element (0). Also, you cannot really index into a set using the [] operator, maybe the example should use lists defined with [0,0,0,0] instead of sets?

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by paddyrg
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants