aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
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>())>;