aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil MacIntosh <neilmac@microsoft.com>2016-09-22 10:22:07 -0700
committerGitHub <noreply@github.com>2016-09-22 10:22:07 -0700
commit348a8595470b2ae7716a99ccacb8189821efb566 (patch)
tree76494ff1a9e98a0bf38d80901c78709746da506d
parente4a34128a80b163e176e100f3bc62c5bd2f9f681 (diff)
parent831be5de39fd297aa8b434554321b54a438107d3 (diff)
downloadplatform_external_Microsoft-GSL-348a8595470b2ae7716a99ccacb8189821efb566.tar.gz
platform_external_Microsoft-GSL-348a8595470b2ae7716a99ccacb8189821efb566.tar.bz2
platform_external_Microsoft-GSL-348a8595470b2ae7716a99ccacb8189821efb566.zip
Removed redundant static_cast<> and is_same<> test.
-rw-r--r--gsl/span11
1 files changed, 4 insertions, 7 deletions
diff --git a/gsl/span b/gsl/span
index d2e16dc..a9a3322 100644
--- a/gsl/span
+++ b/gsl/span
@@ -132,8 +132,7 @@ namespace details
template <class From, class To>
struct is_allowed_element_type_conversion
- : public std::integral_constant<bool, std::is_same<From, std::remove_cv_t<To>>::value ||
- std::is_convertible<From(*)[], To(*)[]>::value>
+ : public std::integral_constant<bool, std::is_convertible<From (*)[], To (*)[]>::value>
{
};
@@ -420,8 +419,7 @@ public:
details::is_allowed_extent_conversion<OtherExtent, Extent>::value &&
details::is_allowed_element_type_conversion<OtherElementType, element_type>::value>>
constexpr span(const span<OtherElementType, OtherExtent>& other)
- : storage_(static_cast<pointer>(other.data()),
- details::extent_type<OtherExtent>(other.size()))
+ : storage_(other.data(), details::extent_type<OtherExtent>(other.size()))
{
}
@@ -431,8 +429,7 @@ public:
details::is_allowed_extent_conversion<OtherExtent, Extent>::value &&
details::is_allowed_element_type_conversion<OtherElementType, element_type>::value>>
constexpr span(span<OtherElementType, OtherExtent>&& other)
- : storage_(static_cast<pointer>(other.data()),
- details::extent_type<OtherExtent>(other.size()))
+ : storage_(other.data(), details::extent_type<OtherExtent>(other.size()))
{
}
@@ -626,7 +623,7 @@ as_writeable_bytes(span<ElementType, Extent> s) noexcept
// Specialization of gsl::at for span
template <class ElementType, std::ptrdiff_t Extent>
-constexpr ElementType& at(const span<ElementType ,Extent>& s, size_t index)
+constexpr ElementType& at(const span<ElementType, Extent>& s, size_t index)
{
// No bounds checking here because it is done in span::operator[] called below
return s[index];