You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by al...@apache.org on 2020/07/09 05:59:48 UTC
[incubator-datasketches-cpp] 02/02: avoid requiring default
constructor for user type
This is an automated email from the ASF dual-hosted git repository.
alsay pushed a commit to branch tuple_sketch
in repository https://gitbox.apache.org/repos/asf/incubator-datasketches-cpp.git
commit 0d0bdc339e6ee12086d53a52660338dbb59a786a
Author: AlexanderSaydakov <Al...@users.noreply.github.com>
AuthorDate: Wed Jul 8 22:59:30 2020 -0700
avoid requiring default constructor for user type
---
tuple/include/theta_union_base_impl.hpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tuple/include/theta_union_base_impl.hpp b/tuple/include/theta_union_base_impl.hpp
index ae56859..10e4478 100644
--- a/tuple/include/theta_union_base_impl.hpp
+++ b/tuple/include/theta_union_base_impl.hpp
@@ -64,7 +64,8 @@ CS theta_union_base<EN, EK, P, S, CS, A>::get_result(bool ordered) const {
if (entries.size() > nominal_num) {
std::nth_element(entries.begin(), entries.begin() + nominal_num, entries.end(), comparator());
theta = EK()(entries[nominal_num]);
- entries.resize(nominal_num);
+ entries.erase(entries.begin() + nominal_num, entries.end());
+ entries.shrink_to_fit();
}
}
if (ordered) std::sort(entries.begin(), entries.end(), comparator());
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org