Fixed conversion problem when creating strided_span from span and bounds

This commit is contained in:
Anna Gringauze committed 2015-11-19 13:13:15 -08:00
1 parent 4552575e34
commit c95eb57d3f
2 files changed
+10 -6

No files matched your search

+6 -2
View File
@@ -1610,8 +1610,12 @@ public:
{}
// from array view
template <std::ptrdiff_t... Dimensions, typename Dummy = std::enable_if<sizeof...(Dimensions) == Rank>>
constexpr strided_span(span<ValueType, Dimensions...> av, bounds_type bounds) : strided_span(av.data(), av.bounds().total_size(), std::move(bounds))
template <typename OtherValueType, std::ptrdiff_t... Dimensions,
bool Enabled1 = (sizeof...(Dimensions) == Rank),
bool Enabled2 = std::is_convertible<OtherValueType*, ValueType*>::value,
typename Dummy = std::enable_if_t<Enabled1 && Enabled2>
>
constexpr strided_span(span<OtherValueType, Dimensions...> av, bounds_type bounds) : strided_span(av.data(), av.bounds().total_size(), std::move(bounds))
{}
// convertible