emscripten-core / emscripten-core/emscripten

unique_ptr defined twice

Open
#9,343 3 comments 5 reactions 1 assignee Claimed by @brendandahl View on GitHub
embind
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

Declaring a smart constructor with unique pointer leads to the following error:
BindingError {name: "BindingError", message: "Cannot register type 'UniqueFoo' twice", stack: "BindingError: Cannot register type 'UniqueFoo…http://localhost:1234/render/appWASM.js:12004:63)"}

the constructor is bound thus:

```
emscripten::class_("Foo")
.smart_ptr_constructor("UniqueFoo", &std::make_unique)
```

Also, if I understand the tests correctly, there might not be any tests for make_unique, only for make_shared.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.