Introduce "optional" alias
MODIFY
include/vcpkg_Dependencies.h
include/vcpkg_Dependencies.h
#include "package_spec.h"
#include "StatusParagraphs.h"
#include "vcpkg_paths.h"
+#include "vcpkg_optional.h"
namespace vcpkg::Dependencies
{
@@ -22,8 +23,8 @@ namespace vcpkg::Dependencies
struct install_plan_action
{
install_plan_type plan_type;
- std::unique_ptr<BinaryParagraph> binary_pgh;
- std::unique_ptr<SourceParagraph> source_pgh;
+ optional<BinaryParagraph> binary_pgh;
+ optional<SourceParagraph> source_pgh;
};
struct package_spec_with_install_plan

ADD
include/vcpkg_optional.h
+#pragma once
+#include <memory>
+
+template<class T>
+using optional = std::unique_ptr<T>;

MODIFY
vcpkglib/vcpkglib.vcxproj
vcpkglib/vcpkglib.vcxproj
<ClInclude Include="..\include\vcpkg_Graphs.h" />
<ClInclude Include="..\include\vcpkg_Input.h" />
<ClInclude Include="..\include\vcpkg_Maps.h" />
+ <ClInclude Include="..\include\vcpkg_optional.h" />
<ClInclude Include="..\include\vcpkg_paths.h" />
<ClInclude Include="..\include\vcpkg_info.h" />
<ClInclude Include="..\include\vcpkg_Sets.h" />

MODIFY
vcpkglib/vcpkglib.vcxproj.filters
vcpkglib/vcpkglib.vcxproj.filters
<ClInclude Include="..\include\pch.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\include\vcpkg_optional.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file

Introduce "optional" alias