aboutsummaryrefslogtreecommitdiffstats
path: root/include/gsl
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2019-08-20 15:44:53 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-08-20 15:44:53 -0700
commit76f3397dd13da6f9c0b7ef7d5eee52d2d64c7995 (patch)
tree52c2d1732f4a79220fb68c98f5cea424f1564522 /include/gsl
parent5a542b476ab01ef1a223655a2d87fe3d83bb78d3 (diff)
parentb04950463b80ae4e15f296962f8def1361119f5f (diff)
downloadplatform_external_Microsoft-GSL-76f3397dd13da6f9c0b7ef7d5eee52d2d64c7995.tar.gz
platform_external_Microsoft-GSL-76f3397dd13da6f9c0b7ef7d5eee52d2d64c7995.tar.bz2
platform_external_Microsoft-GSL-76f3397dd13da6f9c0b7ef7d5eee52d2d64c7995.zip
Upgrade Microsoft-GSL to b576cc6ce375cf42f6537d65a9ef29d67aa6b78e am: 97163d0b88 am: 2c198cc535
am: b04950463b Change-Id: I63888ce2c929e0d6a14a3918ec0b70c9476233d8
Diffstat (limited to 'include/gsl')
-rw-r--r--include/gsl/gsl_byte2
-rw-r--r--include/gsl/gsl_util2
-rw-r--r--include/gsl/multi_span10
-rw-r--r--include/gsl/span2
-rw-r--r--include/gsl/string_span1
5 files changed, 8 insertions, 9 deletions
diff --git a/include/gsl/gsl_byte b/include/gsl/gsl_byte
index 861446d..1670646 100644
--- a/include/gsl/gsl_byte
+++ b/include/gsl/gsl_byte
@@ -56,6 +56,7 @@
#else // _MSC_VER
#ifndef GSL_USE_STD_BYTE
+#include <cstddef> /* __cpp_lib_byte */
// this tests if we are under GCC or Clang with enough -std:c++1z power to get us std::byte
// also check if libc++ version is sufficient (> 5.0) or libstc++ actually contains std::byte
#if defined(__cplusplus) && (__cplusplus >= 201703L) && \
@@ -63,7 +64,6 @@
defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION >= 5000))
#define GSL_USE_STD_BYTE 1
-#include <cstddef>
#else // defined(__cplusplus) && (__cplusplus >= 201703L) &&
// (defined(__cpp_lib_byte) && (__cpp_lib_byte >= 201603) ||
diff --git a/include/gsl/gsl_util b/include/gsl/gsl_util
index 4addde6..0fce689 100644
--- a/include/gsl/gsl_util
+++ b/include/gsl/gsl_util
@@ -37,7 +37,7 @@
#endif // _MSC_VER < 1910
#endif // _MSC_VER
-#if (defined(_MSC_VER) && _MSC_VER < 1910) || (!defined(__clang__) && defined(__GNUC__) && __GUNC__ < 6)
+#if (defined(_MSC_VER) && _MSC_VER < 1910) || (!defined(__clang__) && defined(__GNUC__) && __GNUC__ < 6)
#define GSL_CONSTEXPR_NARROW 0
#else
#define GSL_CONSTEXPR_NARROW 1
diff --git a/include/gsl/multi_span b/include/gsl/multi_span
index f1a909e..0c1506e 100644
--- a/include/gsl/multi_span
+++ b/include/gsl/multi_span
@@ -518,31 +518,31 @@ namespace details
struct TypeListIndexer
{
const TypeChain& obj_;
- TypeListIndexer(const TypeChain& obj) : obj_(obj) {}
+ constexpr TypeListIndexer(const TypeChain& obj) : obj_(obj) {}
template <std::size_t N>
- const TypeChain& getObj(std::true_type)
+ constexpr const TypeChain& getObj(std::true_type)
{
return obj_;
}
template <std::size_t N, typename MyChain = TypeChain,
typename MyBase = typename MyChain::Base>
- auto getObj(std::false_type)
+ constexpr auto getObj(std::false_type)
-> decltype(TypeListIndexer<MyBase>(static_cast<const MyBase&>(obj_)).template get<N>())
{
return TypeListIndexer<MyBase>(static_cast<const MyBase&>(obj_)).template get<N>();
}
template <std::size_t N>
- auto get() -> decltype(getObj<N - 1>(std::integral_constant<bool, N == 0>()))
+ constexpr auto get() -> decltype(getObj<N - 1>(std::integral_constant<bool, N == 0>()))
{
return getObj<N - 1>(std::integral_constant<bool, N == 0>());
}
};
template <typename TypeChain>
- TypeListIndexer<TypeChain> createTypeListIndexer(const TypeChain& obj)
+ constexpr TypeListIndexer<TypeChain> createTypeListIndexer(const TypeChain& obj)
{
return TypeListIndexer<TypeChain>(obj);
}
diff --git a/include/gsl/span b/include/gsl/span
index b4da532..59bd121 100644
--- a/include/gsl/span
+++ b/include/gsl/span
@@ -141,7 +141,7 @@ namespace details
span_iterator() = default;
- constexpr span_iterator(const Span* span, typename Span::index_type idx) noexcept
+ constexpr span_iterator(const Span* span, difference_type idx) noexcept
: span_(span), index_(idx)
{}
diff --git a/include/gsl/string_span b/include/gsl/string_span
index 85112e5..37cbe15 100644
--- a/include/gsl/string_span
+++ b/include/gsl/string_span
@@ -20,7 +20,6 @@
#include <gsl/gsl_assert> // for Ensures, Expects
#include <gsl/gsl_util> // for narrow_cast
#include <gsl/span> // for operator!=, operator==, dynamic_extent
-#include <gsl/pointers> // for not_null
#include <algorithm> // for equal, lexicographical_compare
#include <array> // for array