diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-01-30 16:14:48 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-01-30 21:52:44 -0800 |
| commit | 8de71af4bd94ae1e41bf39a455ed716ac8cdf9bc (patch) | |
| tree | f3c06d83c144eae12d775fef15eff0ece25bf189 | |
| parent | 836de4b0748617db6d06b0eef6fe9ccff9980b1f (diff) | |
| download | vcpkg-8de71af4bd94ae1e41bf39a455ed716ac8cdf9bc.tar.gz vcpkg-8de71af4bd94ae1e41bf39a455ed716ac8cdf9bc.zip | |
Introduce "optional" alias
| -rw-r--r-- | toolsrc/include/vcpkg_Dependencies.h | 5 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg_optional.h | 5 | ||||
| -rw-r--r-- | toolsrc/vcpkglib/vcpkglib.vcxproj | 1 | ||||
| -rw-r--r-- | toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 3 |
4 files changed, 12 insertions, 2 deletions
diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 9180cb65e..2595d9fb8 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -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 diff --git a/toolsrc/include/vcpkg_optional.h b/toolsrc/include/vcpkg_optional.h new file mode 100644 index 000000000..7b935bea9 --- /dev/null +++ b/toolsrc/include/vcpkg_optional.h @@ -0,0 +1,5 @@ +#pragma once +#include <memory> + +template<class T> +using optional = std::unique_ptr<T>; diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index b9722c68e..e6fbfb65a 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -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" /> diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 0f8b03378..7ddfba6f2 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -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>
\ No newline at end of file |
