mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
Removed redundant static_cast<> and is_same<> test.
This commit is contained in:
parent
8361aae39e
commit
831be5de39
9
gsl/span
9
gsl/span
@ -132,8 +132,7 @@ namespace details
|
|||||||
|
|
||||||
template <class From, class To>
|
template <class From, class To>
|
||||||
struct is_allowed_element_type_conversion
|
struct is_allowed_element_type_conversion
|
||||||
: public std::integral_constant<bool, std::is_same<From, std::remove_cv_t<To>>::value ||
|
: public std::integral_constant<bool, std::is_convertible<From (*)[], To (*)[]>::value>
|
||||||
std::is_convertible<From(*)[], To(*)[]>::value>
|
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -420,8 +419,7 @@ public:
|
|||||||
details::is_allowed_extent_conversion<OtherExtent, Extent>::value &&
|
details::is_allowed_extent_conversion<OtherExtent, Extent>::value &&
|
||||||
details::is_allowed_element_type_conversion<OtherElementType, element_type>::value>>
|
details::is_allowed_element_type_conversion<OtherElementType, element_type>::value>>
|
||||||
constexpr span(const span<OtherElementType, OtherExtent>& other)
|
constexpr span(const span<OtherElementType, OtherExtent>& other)
|
||||||
: storage_(static_cast<pointer>(other.data()),
|
: storage_(other.data(), details::extent_type<OtherExtent>(other.size()))
|
||||||
details::extent_type<OtherExtent>(other.size()))
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -431,8 +429,7 @@ public:
|
|||||||
details::is_allowed_extent_conversion<OtherExtent, Extent>::value &&
|
details::is_allowed_extent_conversion<OtherExtent, Extent>::value &&
|
||||||
details::is_allowed_element_type_conversion<OtherElementType, element_type>::value>>
|
details::is_allowed_element_type_conversion<OtherElementType, element_type>::value>>
|
||||||
constexpr span(span<OtherElementType, OtherExtent>&& other)
|
constexpr span(span<OtherElementType, OtherExtent>&& other)
|
||||||
: storage_(static_cast<pointer>(other.data()),
|
: storage_(other.data(), details::extent_type<OtherExtent>(other.size()))
|
||||||
details::extent_type<OtherExtent>(other.size()))
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user