Introduce "optional" alias

This commit is contained in:
Alexander Karatarakis 2017-01-30 16:14:48 -08:00
parent 836de4b074
commit 8de71af4bd
4 changed files with 12 additions and 2 deletions

View File

@ -3,6 +3,7 @@
#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

View File

@ -0,0 +1,5 @@
#pragma once
#include <memory>
template<class T>
using optional = std::unique_ptr<T>;

View File

@ -166,6 +166,7 @@
<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" />

View File

@ -260,5 +260,8 @@
<ClInclude Include="..\include\pch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\vcpkg_optional.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>