diff options
| author | Curtis J Bezault <curtbezault@gmail.com> | 2019-08-20 08:47:26 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-20 08:47:26 -0700 |
| commit | 4da95d667c8600c80b4b5731631ebb7bcbc91f1b (patch) | |
| tree | faa447f7b1beb0d784bbd353a8aa6b449ae71ba2 /toolsrc/include | |
| parent | 463a67897c8249d996f7b41cabb9ac1fb5a35af9 (diff) | |
| download | vcpkg-4da95d667c8600c80b4b5731631ebb7bcbc91f1b.tar.gz vcpkg-4da95d667c8600c80b4b5731631ebb7bcbc91f1b.zip | |
[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
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg/base/util.h | 11 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/build.h | 3 |
2 files changed, 10 insertions, 4 deletions
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 <algorithm> +#include <functional> #include <map> #include <mutex> #include <type_traits> @@ -121,21 +122,23 @@ namespace vcpkg::Util } } - template<class Range> - void sort(Range& cont) + template<class Range, class Comp = std::less<typename Range::value_type>> + 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<class Range> - 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<Range>(cont); } template<class Range1, class Range2> 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); |
