Skip to content

Modify abort condition signature check and call pattern

Paul Gessinger-Befurt 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-Befurt

Merge request reports