Skip to content

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

Merged
brendandahl merged 1 commit into
emscripten-core:mainfrom
CharlieFRuan:patch-1
Oct 7, 2024
Merged

brendandahl merged 1 commit into
emscripten-core:mainfrom
CharlieFRuan:patch-1

Conversation

@CharlieFRuan

@CharlieFRuan CharlieFRuan commented Oct 6, 2024 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Collaborator

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

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