-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Improve embind when using c++17. #10613
Conversation
In C++17, the `noexcept` qualifier became part of the function signature, so we must match it along with const / non-const.
@chadaustin You might find this interesting! |
😮 Seems reasonable to me, but is it possible to have the noexcept specialization defer to the non-noexcept specialization? |
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... |
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; |
There was a problem hiding this comment.
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.
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. |
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.
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.
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.
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.
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.
* 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]>
In C++17, the
noexcept
qualifier became part of the functionsignature, so we must match it along with const / non-const.