Modernize std::any_of with ranges

In WiimoteReal.cpp, JitRegCache.cpp, lambda predicates were replaced by pointers to member functions because ranges algorithms are able invoke those.

In ConvertDialog.cpp, the `std::mem_fn` helper was removed because ranges algorithms are able to handle pointers to member functions as predicates.
This commit is contained in:
mitaclaw
2024-09-30 17:26:50 -07:00
parent 860e6cf5cb
commit 140252ffc0
34 changed files with 69 additions and 82 deletions

View File

@ -90,8 +90,8 @@ void IMUGyroscope::UpdateCalibration(const StateData& state)
// Check for required calibration update frequency
// and if current data is within deadzone distance of mean stable value.
if (calibration_freq < WORST_ACCEPTABLE_CALIBRATION_UPDATE_FREQUENCY ||
std::any_of(current_difference.data.begin(), current_difference.data.end(),
[&](auto c) { return std::abs(c) > deadzone; }))
std::ranges::any_of(current_difference.data,
[&](auto c) { return std::abs(c) > deadzone; }))
{
RestartCalibration();
}