diff --git a/src/TiledArray/tensor/tensor.h b/src/TiledArray/tensor/tensor.h index ed0500d7e7..19452eb233 100644 --- a/src/TiledArray/tensor/tensor.h +++ b/src/TiledArray/tensor/tensor.h @@ -636,7 +636,7 @@ class Tensor { /// \return \c true if this tensor was default constructed (contains no /// data), otherwise \c false. - bool empty() const { return !this->data_; } + bool empty() const { return this->data_.use_count() == 0; } /// MADNESS serialization function diff --git a/src/TiledArray/tensor/utility.h b/src/TiledArray/tensor/utility.h index 6ba90f2fb3..6526691cb7 100644 --- a/src/TiledArray/tensor/utility.h +++ b/src/TiledArray/tensor/utility.h @@ -316,8 +316,8 @@ inline typename T::size_type inner_size(const T& tensor) { /// This function is used as the termination step for the recursive empty() /// function. It also handles the case where there are no tensors in the /// list. -/// \return \c true -inline constexpr bool empty() { return true; } +/// \return \c false +inline constexpr bool empty() { return false; } /// Test for empty tensors