You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add_on_set_parameters_callback(), remove_on_set_parameters_callback(), set_on_parameters_set_callback()
all take a callback as parameter. I think, the callback methods should be able to be marked as noexcept. For example, this currently does not work:
error: no matching function for call to ‘DemoNode::create_wall_timer(std::chrono::milliseconds, std::_Bind_helper<false, void (DemoNode::*)() noexcept, DemoNode*>::type)
Removing the noexcept modifier fixes the issue.
I think it should be possible to add the noexcept modifier to callbacks in timers, services, etc.
Going further, it may only make sense to have these callbacks forced to be noexcept?
Implementation considerations
noexcept has only been available since C++11.
The text was updated successfully, but these errors were encountered:
Going further, it may only make sense to have these callbacks forced to be noexcept?
I don't think we should force the callbacks to be noexcept; there are legitimate reasons for throwing exceptions in them.
That said, I do agree that it would be nice to accept methods that have the noexcept attribute on them. We probably won't have time to look into it right now, but if you'd like to contribute a pull request to add it we'd be happy to review it.
Feature request
Feature description
The rclcpp::Node methods
create_subscription()
create_wall_timer()
create_service()
add_on_set_parameters_callback()
,remove_on_set_parameters_callback()
,set_on_parameters_set_callback()
all take a callback as parameter. I think, the callback methods should be able to be marked as
noexcept
. For example, this currently does not work:Won't compile with this error:
Removing the
noexcept
modifier fixes the issue.I think it should be possible to add the
noexcept
modifier to callbacks in timers, services, etc.Going further, it may only make sense to have these callbacks forced to be noexcept?
Implementation considerations
noexcept
has only been available since C++11.The text was updated successfully, but these errors were encountered: