From 4da95d667c8600c80b4b5731631ebb7bcbc91f1b Mon Sep 17 00:00:00 2001 From: Curtis J Bezault Date: Tue, 20 Aug 2019 08:47:26 -0700 Subject: [vcpkg]Port toolchains (#7687) * checkpoint commit * Only set VCPKG_ENV_OVERRIDES_FILE if it exists * First pass at working port-toolchain * Update VERSION.txt * Return rvalue * Fix compilation error * Some fixes are requested by @ubsan * Fix another compilation error --- toolsrc/include/vcpkg/base/util.h | 11 +++++++---- toolsrc/include/vcpkg/build.h | 3 +++ 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/util.h b/toolsrc/include/vcpkg/base/util.h index 40022a012..3d32e3aa8 100644 --- a/toolsrc/include/vcpkg/base/util.h +++ b/toolsrc/include/vcpkg/base/util.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include #include @@ -121,21 +122,23 @@ namespace vcpkg::Util } } - template - void sort(Range& cont) + template> + void sort(Range& cont, Comp comp = Comp()) { using std::begin; using std::end; - std::sort(begin(cont), end(cont)); + std::sort(begin(cont), end(cont), comp); } template - void sort_unique_erase(Range& cont) + Range&& sort_unique_erase(Range&& cont) { using std::begin; using std::end; std::sort(begin(cont), end(cont)); cont.erase(std::unique(begin(cont), end(cont)), end(cont)); + + return std::forward(cont); } template diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h index cd1821b32..4f6397662 100644 --- a/toolsrc/include/vcpkg/build.h +++ b/toolsrc/include/vcpkg/build.h @@ -270,6 +270,9 @@ namespace vcpkg::Build std::string key; std::string value; + AbiEntry() = default; + AbiEntry(const std::string& key, const std::string& value) : key(key), value(value) {} + bool operator<(const AbiEntry& other) const { return key < other.key || (key == other.key && value < other.value); -- cgit v1.2.3