75template<
typename T>
class Span {
93 constexpr Span() =
default;
100 template<
typename U, BLI_ENABLE_IF((is_span_convertible_po
inter_v<U, T>))>
129 template<
typename U, BLI_ENABLE_IF((is_span_convertible_po
inter_v<U, T>))>
148 return this->
slice(range.
start(), range.size());
159 const int64_t new_size = std::max<int64_t>(0, std::min(size,
size_ - start));
175 const int64_t new_size = std::max<int64_t>(0,
size_ - n);
186 const int64_t new_size = std::max<int64_t>(0,
size_ - n);
216 constexpr const T *
data()
const
225 constexpr const T *
end()
const
230 constexpr std::reverse_iterator<const T *>
rbegin()
const
232 return std::reverse_iterator<const T *>(this->
end());
234 constexpr std::reverse_iterator<const T *>
rend()
const
236 return std::reverse_iterator<const T *>(this->
begin());
280 for (
const T &element : *
this) {
281 if (element == value) {
294 return (this->
begin() <= ptr) && (
ptr < this->
end());
304 for (
const T &element : *
this) {
305 if (element == value) {
344 const T &value =
data_[i];
346 if (value ==
data_[j]) {
366 const T &value =
data_[i];
367 if (other.contains(value)) {
391 if (
data_[i] == search_value) {
410 for (
const T &value : *
this) {
428 if (a.size() !=
b.size()) {
431 return std::equal(a.begin(), a.end(),
b.begin());
465 template<std::
size_t N>
474 template<
typename U, BLI_ENABLE_IF((is_span_convertible_po
inter_v<U, T>))>
476 :
data_(static_cast<T *>(span.data())),
size_(span.size())
485 template<
typename U, BLI_ENABLE_IF((is_span_convertible_po
inter_v<T, U>))>
518 constexpr void fill(
const T &value)
const
529 static_assert(std::is_integral_v<IndexT>);
554 constexpr std::reverse_iterator<T *>
rbegin()
const
556 return std::reverse_iterator<T *>(this->
end());
558 constexpr std::reverse_iterator<T *>
rend()
const
560 return std::reverse_iterator<T *>(this->
begin());
584 return this->
slice(range.
start(), range.size());
595 const int64_t new_size = std::max<int64_t>(0, std::min(size,
size_ - start));
611 const int64_t new_size = std::max<int64_t>(0,
size_ - n);
622 const int64_t new_size = std::max<int64_t>(0,
size_ - n);
704 for (
const T &element : *
this) {
705 if (element == value) {
718 return (this->
begin() <= ptr) && (
ptr < this->
end());
ATTR_WARN_UNUSED_RESULT const BMVert * v
constexpr int64_t start() const
constexpr MutableSpan()=default
constexpr int64_t size() const
constexpr bool contains_ptr(const T *ptr) const
constexpr MutableSpan slice(IndexRange range) const
const T & const_reference
constexpr T & operator[](const int64_t index) const
constexpr std::reverse_iterator< T * > rbegin() const
constexpr MutableSpan slice(const int64_t start, const int64_t size) const
constexpr bool is_empty() const
constexpr MutableSpan< NewT > cast() const
constexpr MutableSpan take_back(const int64_t n) const
constexpr T * data() const
constexpr MutableSpan drop_back(const int64_t n) const
constexpr void fill(const T &value) const
constexpr MutableSpan slice_safe(const int64_t start, const int64_t size) const
constexpr MutableSpan drop_front(const int64_t n) const
constexpr int64_t size_in_bytes() const
constexpr Span< T > as_span() const
constexpr T * end() const
constexpr MutableSpan(std::array< T, N > &array)
constexpr void reverse() const
constexpr T & first() const
constexpr int64_t count(const T &value) const
constexpr T * begin() const
constexpr MutableSpan(std::vector< T > &vector)
constexpr MutableSpan slice_safe(IndexRange range) const
constexpr std::reverse_iterator< T * > rend() const
constexpr IndexRange index_range() const
constexpr void copy_from(Span< T > values) const
constexpr MutableSpan(T *start, const int64_t size)
constexpr void fill_indices(Span< IndexT > indices, const T &value) const
constexpr MutableSpan(MutableSpan< U > span)
constexpr MutableSpan take_front(const int64_t n) const
constexpr T & last(const int64_t n=0) const
friend bool operator!=(const Span< T > a, const Span< T > b)
constexpr Span drop_front(int64_t n) const
Span< NewT > constexpr cast() const
constexpr Span slice_safe(const int64_t start, const int64_t size) const
constexpr Span slice(int64_t start, int64_t size) const
constexpr Span(Span< U > span)
constexpr int64_t size_in_bytes() const
constexpr std::reverse_iterator< const T * > rend() const
constexpr std::reverse_iterator< const T * > rbegin() const
constexpr const T * data() const
constexpr Span take_back(int64_t n) const
constexpr int64_t first_index_try(const T &search_value) const
friend bool operator==(const Span< T > a, const Span< T > b)
constexpr Span slice(IndexRange range) const
constexpr const T & operator[](int64_t index) const
constexpr Span(const std::vector< T > &vector)
constexpr Span(const T *start, int64_t size)
constexpr Span drop_back(int64_t n) const
constexpr int64_t count(const T &value) const
constexpr const T & first() const
constexpr bool has_duplicates__linear_search() const
constexpr int64_t first_index(const T &search_value) const
constexpr Span(const U *start, int64_t size)
constexpr int64_t size() const
constexpr const T & last(const int64_t n=0) const
constexpr const T * end() const
constexpr Span(const std::array< T, N > &array)
constexpr IndexRange index_range() const
constexpr const T * begin() const
constexpr Span(const std::initializer_list< T > &list)
constexpr uint64_t hash() const
constexpr Span slice_safe(IndexRange range) const
const T & const_reference
constexpr Span take_front(int64_t n) const
constexpr bool is_empty() const
constexpr bool contains(const T &value) const
constexpr bool contains_ptr(const T *ptr) const
constexpr bool intersects__linear_search(Span other) const
local_group_size(16, 16) .push_constant(Type b
void initialized_fill_n(T *dst, int64_t n, const T &value)
uint64_t get_default_hash(const T &v)
void initialized_copy_n(const T *src, int64_t n, T *dst)
unsigned __int64 uint64_t