Skip to content
Snippets Groups Projects

Modify abort condition signature check and call pattern

Merged Paul Gessinger requested to merge aborter-signature-check into master

The detection mechanism appears to have been not quite in sync with the call mechanism that was used. This rewrites the detection mechanism to be simpler and correct:

  • IF the aborter does not have a member type action_type, the check requires the operator to take const propagator_state_t&, const stepper_t&
template <typename propagator_state_t, typename stepper_t>
bool
operator()(const propagator_state_t& state, const stepper_t& stepper) const
{
  return false;
}
  • IF the aborter has a member type action_type, the check requires the operator to take const propagator_state_t&, const stepper_t&, const result_t&
template <typename propagator_state_t, typename stepper_t,
          typename result_t>
bool
operator()(const propagator_state_t& state,
           const stepper_t, const result_t& r) const
{
  return false;
}

The result argument is now last, which is much more intuitive. An aborter can declare both overloads, but only the checked one will ever be called by the implementation.

This also adds explicit tests of this behaviour.

Edited by Paul Gessinger

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading