aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorPhil Christensen <philc@microsoft.com>2019-08-23 11:18:34 -0700
committerGitHub <noreply@github.com>2019-08-23 11:18:34 -0700
commitbd4678610b221ae6cd4911295e84808ea7924cc6 (patch)
tree1e51033d924c41cd147f33665990b75fe19ff4b7 /toolsrc/include
parent1245f1dbfc383d33b2fa576f010644de9687280e (diff)
parentcf447c050c734fc71e5254ea9e05e1bc4a9d208d (diff)
downloadvcpkg-bd4678610b221ae6cd4911295e84808ea7924cc6.tar.gz
vcpkg-bd4678610b221ae6cd4911295e84808ea7924cc6.zip
Merge branch 'master' into multi_line_depends
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/vcpkg/base/util.h11
-rw-r--r--toolsrc/include/vcpkg/build.h3
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);