Add compare_by_name to InstallPlan
MODIFY
include/vcpkg_Dependencies.h
include/vcpkg_Dependencies.h
@@ -40,6 +40,8 @@ namespace vcpkg::Dependencies
struct PackageSpecWithInstallPlan
{
+ static bool compare_by_name(const PackageSpecWithInstallPlan* left, const PackageSpecWithInstallPlan* right);
+
PackageSpecWithInstallPlan(const PackageSpec& spec, InstallPlanAction&& plan);
PackageSpec spec;

MODIFY
src/vcpkg_Dependencies.cpp
src/vcpkg_Dependencies.cpp
@@ -26,6 +26,10 @@ namespace vcpkg::Dependencies
InstallPlanAction::InstallPlanAction(const InstallPlanType& plan_type, Optional<BinaryParagraph> binary_pgh, Optional<SourceParagraph> source_pgh)
: plan_type(std::move(plan_type)), binary_pgh(std::move(binary_pgh)), source_pgh(std::move(source_pgh)) { }
+ bool PackageSpecWithInstallPlan::compare_by_name(const PackageSpecWithInstallPlan* left, const PackageSpecWithInstallPlan* right)
+ {
+ return left->spec.name() < right->spec.name();
+ }
PackageSpecWithInstallPlan::PackageSpecWithInstallPlan(const PackageSpec& spec, InstallPlanAction&& plan) : spec(spec), plan(std::move(plan)) { }

Add compare_by_name to InstallPlan