Use ranges
C++20 brought us std::ranges for a lot of algorithms. Most of these
conversions were done using comby, similar to:
```
comby -verbose 'std::lower_bound(:[a].begin(),:[b].end(),:[c])' 'std::ranges::lower_bound(:[a], :[c])' $(git ls-files | grep "\.[hc]\(pp\)\?$") -in-place
```
Change-Id: I0c99c04e9368312555c08147d474ca93a5959e8d
Signed-off-by: Ed Tanous <edtanous@google.com>
diff --git a/redfish-core/include/utils/collection.hpp b/redfish-core/include/utils/collection.hpp
index 862be90..0801cd5 100644
--- a/redfish-core/include/utils/collection.hpp
+++ b/redfish-core/include/utils/collection.hpp
@@ -9,6 +9,7 @@
#include <boost/url/url.hpp>
#include <nlohmann/json.hpp>
+#include <ranges>
#include <span>
#include <string>
#include <string_view>
@@ -68,8 +69,7 @@
}
pathNames.push_back(leaf);
}
- std::sort(pathNames.begin(), pathNames.end(),
- AlphanumLess<std::string>());
+ std::ranges::sort(pathNames, AlphanumLess<std::string>());
nlohmann::json& members = asyncResp->res.jsonValue["Members"];
members = nlohmann::json::array();