Skip to content

[Doc] embind.rst - remove "Optional" arg from register_optional #22687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

CharlieFRuan
Copy link
Contributor

@CharlieFRuan CharlieFRuan commented Oct 6, 2024

Calling register_optional<std::string>("Optional"); results in:

error: no matching function for call to 'register_optional'
    8 |   emscripten::register_optional<std::string>("Optional");
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/path/to/emsdk/upstream/emscripten/cache/sysroot/include/emscripten/bind.h:1880:6: note: candidate function template not viable: requires 0 arguments, but 1 was provided
 1880 | void register_optional() {
      |      ^
1 error generated

As shown in later in the doc and in usage in #21076, register_optional should not take in an argument. Also see the source code:

void register_optional() {

@CharlieFRuan
Copy link
Contributor Author

Hmm not sure how to rerun the test -- I think the test failing shouldn't relate to the change in this PR which is just a one-line change of the doc

@brendandahl
Copy link
Collaborator

Those are unrelated failures due to some output size tests changing.

@brendandahl brendandahl merged commit 326703c into emscripten-core:main Oct 7, 2024
22 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants