Skip to content
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

Improve embind when using c++17. #10613

Conversation

waywardmonkeys
Copy link
Contributor

In C++17, the noexcept qualifier became part of the function
signature, so we must match it along with const / non-const.

In C++17, the `noexcept` qualifier became part of the function
signature, so we must match it along with const / non-const.
@waywardmonkeys
Copy link
Contributor Author

@chadaustin You might find this interesting!

@chadaustin
Copy link
Collaborator

😮 Seems reasonable to me, but is it possible to have the noexcept specialization defer to the non-noexcept specialization?

@waywardmonkeys
Copy link
Contributor Author

Any further thoughts on this? I'd really like to see this land before the next emscipten release so that I can update to it more readily...

@kripken
Copy link
Member

kripken commented Apr 14, 2020

Looks like @chadaustin had a question?

Also maybe @jgravelle-google will have thoughts.

ReturnType (ClassType::*memberFunction)(Args...) const) {
auto invoker = &MethodInvoker<decltype(memberFunction), ReturnType, const ClassType*, Args...>::invoke;

typename WithPolicies<Policies...>::template ArgTypeList<ReturnType, AllowedRawPointer<const ClassType>, Args...> args;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the only line of difference between the bodies of these two methods? That's really hard to spot in the middle of the rest of this duplicated code. Any way to compress these into one body?

Basically what @chadaustin said, yeah.

Base automatically changed from master to main March 8, 2021 23:49
@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.

@stale stale bot added the wontfix label Apr 16, 2022
brendandahl added a commit to brendandahl/emscripten that referenced this pull request Jun 2, 2022
This continues the work from emscripten-core#15273 and emscripten-core#10613 which supports the noexcept
keyword by ignoring it on c++17 compilers. I've also added a missing
template for class methods and tests for each possible use of noexcept.
brendandahl added a commit to brendandahl/emscripten that referenced this pull request Jun 3, 2022
This continues the work from emscripten-core#15273 and emscripten-core#10613 which supports the noexcept
keyword by ignoring it on c++17 compilers. I've also added a missing
template for class methods and tests for each possible use of noexcept.
brendandahl added a commit to brendandahl/emscripten that referenced this pull request Jun 7, 2022
This continues the work from emscripten-core#15273 and emscripten-core#10613 which supports the noexcept
keyword by ignoring it on c++17 compilers. I've also added a missing
template for class methods and tests for each possible use of noexcept.
brendandahl added a commit to brendandahl/emscripten that referenced this pull request Jun 9, 2022
This continues the work from emscripten-core#15273 and emscripten-core#10613 which supports the noexcept
keyword by ignoring it on c++17 compilers. I've also added a missing
template for class methods and tests for each possible use of noexcept.
brendandahl added a commit to brendandahl/emscripten that referenced this pull request Jun 9, 2022
This continues the work from emscripten-core#15273 and emscripten-core#10613 which supports the noexcept
keyword by ignoring it on c++17 compilers. I've also added a missing
template for class methods and tests for each possible use of noexcept.
brendandahl added a commit that referenced this pull request Jun 10, 2022
* Add support for noexcept keyword in C++ class methods

* Remove code duplication after adding support for noexcept

* Add support for noexcept keyword to embind.

This continues the work from #15273 and #10613 which supports the noexcept
keyword by ignoring it on c++17 compilers. I've also added a missing
template for class methods and tests for each possible use of noexcept.

Co-authored-by: Hunter Richards <[email protected]>
@stale stale bot closed this Jun 13, 2022
@waywardmonkeys waywardmonkeys deleted the embind-noexcept-c++17 branch February 22, 2023 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants