diff --git a/source/source_lcao/module_hcontainer/hcontainer.cpp b/source/source_lcao/module_hcontainer/hcontainer.cpp index 3b65203d8a..9571fe40c8 100644 --- a/source/source_lcao/module_hcontainer/hcontainer.cpp +++ b/source/source_lcao/module_hcontainer/hcontainer.cpp @@ -46,6 +46,7 @@ HContainer::HContainer(HContainer&& HR_in) noexcept this->wrapper_pointer = HR_in.wrapper_pointer; this->gamma_only = HR_in.gamma_only; this->paraV = HR_in.paraV; + this->allocated = HR_in.allocated; this->current_R = -1; HR_in.wrapper_pointer = nullptr; // tmp terms not moved @@ -63,6 +64,7 @@ HContainer& HContainer::operator=(HContainer&& HR_in) noexcept this->wrapper_pointer = HR_in.wrapper_pointer; this->gamma_only = HR_in.gamma_only; this->paraV = HR_in.paraV; + this->allocated = HR_in.allocated; this->current_R = -1; HR_in.wrapper_pointer = nullptr; diff --git a/source/source_lcao/module_hcontainer/hcontainer.h b/source/source_lcao/module_hcontainer/hcontainer.h index eddfe5db6b..7592273fdb 100644 --- a/source/source_lcao/module_hcontainer/hcontainer.h +++ b/source/source_lcao/module_hcontainer/hcontainer.h @@ -154,7 +154,10 @@ class HContainer * data of HR_in will not be copied, please call add() after this constructor to copy data. */ HContainer(const HContainer& HR_in, T* data_array = nullptr); - + + // copy assignment, not allowed + HContainer& operator=(const HContainer& HR_in) = delete; + // move constructor HContainer(HContainer&& HR_in) noexcept; // move assignment