73 template<
typename T>
class Span {
91 constexpr
Span() =
default;
98 template<
typename U, BLI_ENABLE_IF((is_span_convertible_po
inter_v<U, T>))>
115 constexpr
Span(
const std::initializer_list<T> &list)
133 template<
typename U, BLI_ENABLE_IF((is_span_convertible_po
inter_v<U, T>))>
162 const int64_t new_size = std::max<int64_t>(0,
size_ - n);
173 const int64_t new_size = std::max<int64_t>(0,
size_ - n);
217 constexpr std::reverse_iterator<const T *>
rbegin()
const
219 return std::reverse_iterator<const T *>(this->
end());
221 constexpr std::reverse_iterator<const T *>
rend()
const
223 return std::reverse_iterator<const T *>(this->
begin());
281 return (this->
begin() <= ptr) && (
ptr < this->
end());
326 if (index < size_ && index >= 0) {
343 const T &value =
data_[i];
345 if (value ==
data_[j]) {
365 const T &value =
data_[i];
390 if (
data_[i] == search_value) {
418 if (
a.size() !=
b.size()) {
421 return std::equal(
a.begin(),
a.end(),
b.begin());
433 template<
typename Pr
intLineF>
void print_as_lines(std::string name, PrintLineF print_line)
const
435 std::cout <<
"Span: " << name <<
" \tSize:" <<
size_ <<
'\n';
436 for (
const T &value : *
this) {
449 this->
print_as_lines(name, [](
const T &value) { std::cout << value; });
482 template<std::
size_t N>
491 template<
typename U, BLI_ENABLE_IF((is_span_convertible_po
inter_v<U, T>))>
502 template<
typename U, BLI_ENABLE_IF((is_span_convertible_po
inter_v<T, U>))>
562 constexpr std::reverse_iterator<T *>
rbegin()
const
564 return std::reverse_iterator<T *>(this->
end());
566 constexpr std::reverse_iterator<T *>
rend()
const
568 return std::reverse_iterator<T *>(this->
begin());
601 const int64_t new_size = std::max<int64_t>(0,
size_ - n);
612 const int64_t new_size = std::max<int64_t>(0,
size_ - n);
728 const int64_t min_required_size = start_ + size_;
729 const int64_t current_array_size = s_current_array_size.load(std::memory_order_acquire);
730 const int64_t *current_array = s_current_array.load(std::memory_order_acquire);
731 if (min_required_size <= current_array_size) {
734 return this->as_span_internal();
ATTR_WARN_UNUSED_RESULT const void * element
Span< int64_t > as_span() const
constexpr int64_t size() const
constexpr int64_t start() const
constexpr MutableSpan()=default
constexpr int64_t size() const
constexpr T * end() const
constexpr T & operator[](const int64_t index) const
constexpr void fill(const T &value)
constexpr MutableSpan slice(IndexRange range) const
const T & const_reference
constexpr MutableSpan< NewT > cast() const
constexpr MutableSpan slice(const int64_t start, const int64_t size) const
constexpr bool is_empty() const
constexpr MutableSpan take_back(const int64_t n) const
constexpr MutableSpan drop_back(const int64_t n) const
constexpr MutableSpan drop_front(const int64_t n) const
constexpr void fill_indices(Span< int64_t > indices, const T &value)
constexpr T & last(const int64_t n=0) const
constexpr MutableSpan(std::array< T, N > &array)
constexpr void copy_from(Span< T > values)
constexpr std::reverse_iterator< T * > rend() const
constexpr std::reverse_iterator< T * > rbegin() const
constexpr int64_t count(const T &value) const
constexpr Span< T > as_span() const
constexpr MutableSpan(std::vector< T > &vector)
constexpr T * begin() const
constexpr IndexRange index_range() const
constexpr T * data() const
constexpr MutableSpan(T *start, const int64_t size)
constexpr T & first() const
constexpr MutableSpan(MutableSpan< U > span)
constexpr MutableSpan take_front(const int64_t n) const
friend bool operator!=(const Span< T > a, const Span< T > b)
constexpr std::reverse_iterator< const T * > rend() const
constexpr Span drop_front(int64_t n) const
constexpr std::reverse_iterator< const T * > rbegin() const
constexpr Span slice(int64_t start, int64_t size) const
constexpr Span(Span< U > span)
constexpr int64_t size_in_bytes() const
constexpr const T & operator[](int64_t index) const
void print_as_lines(std::string name) 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)
void print_as_lines(std::string name, PrintLineF print_line) const
constexpr Span slice(IndexRange range) const
constexpr const T * data() 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 T get(int64_t index, const T &fallback) const
constexpr int64_t count(const T &value) const
constexpr bool has_duplicates__linear_search() const
constexpr const T & first() const
constexpr const T & last(const int64_t n=0) 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 Span< NewT > cast() const
constexpr Span(const std::array< T, N > &array)
constexpr IndexRange index_range() const
constexpr Span(const std::initializer_list< T > &list)
constexpr const T * end() const
const T & const_reference
constexpr Span take_front(int64_t n) const
constexpr const T * begin() 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
ccl_gpu_kernel_postfix ccl_global int * counter
ccl_gpu_kernel_postfix int ccl_global int * indices
void initialized_fill_n(T *dst, int64_t n, const T &value)
void initialized_copy_n(const T *src, int64_t n, T *dst)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)