From 860e6cf5cb7d96499aecf6f6067783bdb71c29ad Mon Sep 17 00:00:00 2001 From: mitaclaw <140017135+mitaclaw@users.noreply.github.com> Date: Sun, 29 Sep 2024 11:43:52 -0700 Subject: Modernize `std::all_of` with ranges In DITSpecification.cpp, MaterialAsset.cpp, and ShaderAsset.cpp, lambda predicates were replaced by pointers to member functions because ranges algorithms are able invoke those. In NetPlayClient.cpp, the non-trivial `NetPlay::Player` elements were being passed by value in `NetPlayClient::DoAllPlayersHaveGame()`. This has been fixed. In WIABlob.cpp, the second example's predicate was returning the `std::optional` by value instead of implicitly converting it to a bool. This has been fixed. --- .../Core/InputCommon/ControllerEmu/ControlGroup/IMUAccelerometer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/InputCommon/ControllerEmu/ControlGroup/IMUAccelerometer.cpp') diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/IMUAccelerometer.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/IMUAccelerometer.cpp index dfd282d533..d6cb4b95ff 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/IMUAccelerometer.cpp +++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/IMUAccelerometer.cpp @@ -25,8 +25,8 @@ IMUAccelerometer::IMUAccelerometer(std::string name_, std::string ui_name_) bool IMUAccelerometer::AreInputsBound() const { - return std::all_of(controls.begin(), controls.end(), - [](const auto& control) { return control->control_ref->BoundCount() > 0; }); + return std::ranges::all_of( + controls, [](const auto& control) { return control->control_ref->BoundCount() > 0; }); } std::optional IMUAccelerometer::GetState() const -- cgit v1.2.3