16#include <initializer_list>
27#if defined(__clang__) && defined(__has_cpp_attribute) && __has_cpp_attribute(clang::lifetimebound)
28#define SK_CHECK_IL_LIFETIME [[clang::lifetimebound]]
30#define SK_CHECK_IL_LIFETIME
67 constexpr SkSpan() : fPtr{nullptr}, fSize{0} {}
69 template <
typename Integer, std::enable_if_t<std::is_
integral_v<Integer>,
bool> = true>
74 template <
typename U,
typename = std::enable_if_t<std::is_same_v<const U, T>>>
78 template<
typename Container>
90 constexpr T*
begin()
const {
return fPtr; }
91 constexpr T*
end()
const {
return fPtr + fSize; }
92 constexpr auto rbegin()
const {
return std::make_reverse_iterator(this->
end()); }
93 constexpr auto rend()
const {
return std::make_reverse_iterator(this->
begin()); }
95 constexpr size_t size()
const {
return fSize; }
96 constexpr bool empty()
const {
return fSize == 0; }
97 constexpr size_t size_bytes()
const {
return fSize *
sizeof(
T); }
102 return SkSpan{fPtr + (this->
size() - postfixLen),
106 return this->
subspan(offset, this->
size() - offset);
127template <
typename Container>
SK_API void sk_collection_not_empty(bool empty)
SK_API T sk_collection_check_bounds(T i, T size)
SK_API T sk_collection_check_length(T i, T size)
#define SK_CHECK_IL_LIFETIME
SkSpan(Container &&) -> SkSpan< std::remove_pointer_t< decltype(std::data(std::declval< Container >()))> >
constexpr size_t SkToSizeT(S x)
constexpr SkSpan(const SkSpan< U > &that)
constexpr SkSpan(T(&a)[N])
constexpr SkSpan< T > last(size_t postfixLen) const
constexpr SkSpan< T > subspan(size_t offset, size_t count) const
constexpr SkSpan< T > first(size_t prefixLen) const
constexpr T & front() const
constexpr SkSpan< T > subspan(size_t offset) const
constexpr SkSpan(T *ptr, Integer size)
constexpr SkSpan(const SkSpan &o)=default
constexpr SkSpan & operator=(const SkSpan &that)=default
SkSpan(std::initializer_list< T > il SK_CHECK_IL_LIFETIME)
constexpr T * data() const
constexpr T * begin() const
constexpr T & back() const
constexpr T * end() const
constexpr T & operator[](size_t i) const
constexpr SkSpan(Container &&c)
constexpr bool empty() const
constexpr size_t size_bytes() const
constexpr auto rbegin() const
constexpr auto rend() const
constexpr size_t size() const
static float max(float r, float g, float b)