Add compare_by_name to InstallPlan

This commit is contained in:
Alexander Karatarakis 2017-04-07 13:02:50 -07:00
parent 1281f66c39
commit c85de257c8
2 changed files with 6 additions and 0 deletions

View File

@ -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;

View File

@ -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)) { }