Skip to content
Discussion options

You must be logged in to vote

The JS object representing the C++ object is just a thin wrapper. Embind doesn't cache the wrappers so it's not able to provide the same wrapper everytime the C++ object is passed into JS. Some alternatives:

  1. Put the extraProp as a member in the C++ MyClass and add a binding for it.
  2. Add a val member to MyClass and put the properties there.
  3. Maintain your own map in JS of C++ object to some properties.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@stevenwdv
Comment options

@brendandahl
Comment options

Answer selected by stevenwdv
@stevenwdv
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants