WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
Use std::optional overloaded operator to handle all of the comparisons in DependencyList::Add. The operator already properly handles all of the cases, including treating std::nullopt as always less than a defined value.
Also optimize a few other places around a reference to MinVersion.
Validation
Added a unit test covering the cases where Add needs to merge the minimum version value.
Likely fix for #4972
Change
Use
std::optional
overloaded operator to handle all of the comparisons inDependencyList::Add
. The operator already properly handles all of the cases, including treatingstd::nullopt
as always less than a defined value.Also optimize a few other places around a reference to
MinVersion
.Validation
Added a unit test covering the cases where
Add
needs to merge the minimum version value.Microsoft Reviewers: Open in CodeFlow