diff --git a/include/knowhere/index.h b/include/knowhere/index.h index bbfe88e4d..06022b311 100644 --- a/include/knowhere/index.h +++ b/include/knowhere/index.h @@ -43,6 +43,20 @@ class Index { node = idx.node; } + Index& + operator=(const Index& idx) { + if (&idx == this) { + return *this; + } + if (idx.node == nullptr) { + node = nullptr; + return *this; + } + idx.node->IncRef(); + node = idx.node; + return *this; + } + Index(Index&& idx) { if (idx.node == nullptr) { node = nullptr;