diff options
| author | Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> | 2019-08-21 12:00:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-21 12:00:35 +0200 |
| commit | 18d61a3fb140ac1f4d9d605e02fdd614e1c2ff14 (patch) | |
| tree | ef87d17ad7f6648a47c3367bf2acca5197a107dd /toolsrc/include | |
| parent | 70f4aabbe8bf5273e11a03f804d4361354cf0a11 (diff) | |
| parent | e5bf7eae99f3be342bfdd7a3c999daba62d4436a (diff) | |
| download | vcpkg-18d61a3fb140ac1f4d9d605e02fdd614e1c2ff14.tar.gz vcpkg-18d61a3fb140ac1f4d9d605e02fdd614e1c2ff14.zip | |
Merge branch 'master' into path_separator
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); |
