Return const ref in array::data_shared_ptr (#2100)

This commit is contained in:
Cheng 2025-04-21 22:17:09 +08:00 committed by GitHub
parent b13f2aed16
commit 70ebc3b598
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -339,11 +339,11 @@ class array {
return allocator::allocator().size(buffer()); return allocator::allocator().size(buffer());
} }
// Return a copy of the shared pointer // Return the shared pointer to the array::Data struct
// to the array::Data struct const std::shared_ptr<Data>& data_shared_ptr() const {
std::shared_ptr<Data> data_shared_ptr() const {
return array_desc_->data; return array_desc_->data;
} }
// Return a raw pointer to the arrays data // Return a raw pointer to the arrays data
template <typename T> template <typename T>
T* data() { T* data() {