Fix compile error on GCC.

This commit is contained in:
刘雨培 2016-04-22 13:25:53 +08:00
parent adae9bc473
commit 453321704f

View File

@ -1688,12 +1688,6 @@ constexpr auto as_span(T* const& ptr, dim<Dimensions>... args)
details::static_as_span_helper<static_bounds<Dimensions...>>(args..., details::Sep{})}; details::static_as_span_helper<static_bounds<Dimensions...>>(args..., details::Sep{})};
} }
template<typename Span>
constexpr Span as_span(contiguous_span_iterator<Span> start, contiguous_span_iterator<Span> last)
{
return { &*start, static_cast<typename Span::size_type>(last - start)};
}
template <typename T> template <typename T>
constexpr auto as_span(T* arr, std::ptrdiff_t len) -> constexpr auto as_span(T* arr, std::ptrdiff_t len) ->
typename details::SpanArrayTraits<T, dynamic_range>::type typename details::SpanArrayTraits<T, dynamic_range>::type
@ -2098,6 +2092,13 @@ contiguous_span_iterator<Span> operator+(typename contiguous_span_iterator<Span>
return rhs + n; return rhs + n;
} }
template<typename Span>
constexpr Span as_span(contiguous_span_iterator<Span> start, contiguous_span_iterator<Span> last)
{
return { &*start, static_cast<typename Span::size_type>(last - start) };
}
template <typename Span> template <typename Span>
class general_span_iterator class general_span_iterator
: public std::iterator<std::random_access_iterator_tag, typename Span::value_type> : public std::iterator<std::random_access_iterator_tag, typename Span::value_type>