aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorgnaggnoyil <gnaggnoyil@gmail.com>2019-07-10 04:02:48 +0800
committerCurtis J Bezault <curtbezault@gmail.com>2019-07-09 16:02:48 -0400
commit7f80c0e2d311c7ff2453bdd558e4e7fd91cea872 (patch)
tree2ab8cd4514926f64e4e210696c151bc31d90ab45 /toolsrc/include
parenta15e2446faadd558171cd08f352bf51cb659d13a (diff)
downloadvcpkg-7f80c0e2d311c7ff2453bdd558e4e7fd91cea872.tar.gz
vcpkg-7f80c0e2d311c7ff2453bdd558e4e7fd91cea872.zip
Make handle features (#6797)
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/vcpkg/base/util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/toolsrc/include/vcpkg/base/util.h b/toolsrc/include/vcpkg/base/util.h
index 213adb67c..e629ef0b2 100644
--- a/toolsrc/include/vcpkg/base/util.h
+++ b/toolsrc/include/vcpkg/base/util.h
@@ -6,9 +6,18 @@
#include <unordered_map>
#include <utility>
#include <vector>
+#include <type_traits>
namespace vcpkg::Util
{
+ template <class T>
+ constexpr std::add_const_t<T>& as_const(T& t) noexcept
+ {
+ return t;
+ }
+ template <class T>
+ void as_const(const T&&) = delete;
+
template<class Container>
using ElementT =
std::remove_reference_t<decltype(*std::declval<typename std::remove_reference_t<Container>::iterator>())>;