diff options
| author | huahang <huahang@users.noreply.github.com> | 2020-08-25 09:14:38 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-24 18:14:38 -0700 |
| commit | 99b07566f4e86f70ac2112a097e913ff180c9f20 (patch) | |
| tree | 7b598d8f73fece79684a36b26d922dde81341c72 | |
| parent | 08423be1555b2256dbc564a156ac5ff54860bc73 (diff) | |
| download | vcpkg-99b07566f4e86f70ac2112a097e913ff180c9f20.tar.gz vcpkg-99b07566f4e86f70ac2112a097e913ff180c9f20.zip | |
[vcpkg] Fix build on old compilers. (#12950)
| -rw-r--r-- | toolsrc/include/vcpkg/base/expected.h | 3 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/base/span.h | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/toolsrc/include/vcpkg/base/expected.h b/toolsrc/include/vcpkg/base/expected.h index d8a2cacaa..fcf37bcaf 100644 --- a/toolsrc/include/vcpkg/base/expected.h +++ b/toolsrc/include/vcpkg/base/expected.h @@ -4,6 +4,7 @@ #include <vcpkg/base/stringliteral.h> #include <system_error> +#include <type_traits> namespace vcpkg { @@ -111,7 +112,7 @@ namespace vcpkg ExpectedT(S&& s, ExpectedRightTag = {}) : m_s(std::move(s)) { } ExpectedT(const T& t, ExpectedLeftTag = {}) : m_t(t) { } - template<class = std::enable_if<!std::is_reference_v<T>>> + template<class = std::enable_if<!std::is_reference<T>::value>> ExpectedT(T&& t, ExpectedLeftTag = {}) : m_t(std::move(t)) { } diff --git a/toolsrc/include/vcpkg/base/span.h b/toolsrc/include/vcpkg/base/span.h index 221cccc8c..a66205332 100644 --- a/toolsrc/include/vcpkg/base/span.h +++ b/toolsrc/include/vcpkg/base/span.h @@ -3,6 +3,7 @@ #include <array> #include <cstddef> #include <initializer_list> +#include <type_traits> #include <vector> namespace vcpkg @@ -29,7 +30,7 @@ namespace vcpkg { } - template<size_t N, class = std::enable_if_t<std::is_const_v<T>>> + template<size_t N, class = std::enable_if_t<std::is_const<T>::value>> constexpr Span(std::remove_const_t<T> (&arr)[N]) noexcept : m_ptr(arr), m_count(N) { } |
