use moving update
diff --git a/cpp/src/cpc_union_accuracy_profile.cpp b/cpp/src/cpc_union_accuracy_profile.cpp
index 983e775..7718abb 100644
--- a/cpp/src/cpc_union_accuracy_profile.cpp
+++ b/cpp/src/cpc_union_accuracy_profile.cpp
@@ -43,7 +43,7 @@
     }
     count += delta;
     for (auto& sketch: sketches) {
-      u.update(*sketch);
+      u.update(std::move(*sketch));
     }
     cpc_sketch result = u.get_result();
     stat.update(
diff --git a/cpp/src/theta_union_accuracy_profile.cpp b/cpp/src/theta_union_accuracy_profile.cpp
index 5964f88..61cf67e 100644
--- a/cpp/src/theta_union_accuracy_profile.cpp
+++ b/cpp/src/theta_union_accuracy_profile.cpp
@@ -45,7 +45,7 @@
     }
     count += delta;
     for (auto& sketch: sketches) {
-      u.update(*sketch);
+      u.update(std::move(*sketch));
     }
     compact_theta_sketch result = u.get_result();
     stat.update(