Skip to content

Creating a map in C++ as a parameter of a Berry function #426

Answered by s-hadinger
Sebight asked this question in Q&A
Discussion options

You must be logged in to vote

There is a difference between the internal map structure, and the map instance which wraps the internal structure into a class instance of map.

What I typically do is be_newobject(vm, "map"); to instanciate an empty map and then add elements with berry high level functions.

See https://github.com/arendst/Tasmota/blob/89b4376e3160b304924802de76cd057827f15a64/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota.ino#L172

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@s-hadinger
Comment options

@Sebight
Comment options

Answer selected by Sebight
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