emscripten-core / emscripten-core/emscripten
Question: How to expose a static pointer property
Open
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
Hello,
I have a class which contains a static pointer property that I would like to expose to my JavaScript code, however I cannot seem to find a way of doing this. Exposing the property without marking it with `allow_raw_pointers()` doesn't work (as expected) but marking a `class_property` in Embind with `allow_raw_pointers()` seems impossible too.
I would like to do something like this:
```lang-c
class Test {
public:
static int* number;
};
EMSCRIPTEN_BINDINGS(test) {
class_("Test")
.class_property("number", &Test::number, allow_raw_pointers());
}
```
How can I expose such a property in Embind?
Contributor guide
Assessment
This issue has not been assessed yet.