diff --git a/keys.hh b/keys.hh index e6ac630697..0570821691 100644 --- a/keys.hh +++ b/keys.hh @@ -168,7 +168,7 @@ public: template static TopLevel from_exploded(RangeOfSerializedComponents&& v) { - return TopLevel(std::forward(v)); + return TopLevel::from_range(std::forward(v)); } static TopLevel from_exploded(const schema& s, const std::vector& v) { @@ -615,8 +615,12 @@ public: using c_type = compound_type; template - partition_key(RangeOfSerializedComponents&& v) - : compound_wrapper(managed_bytes(c_type::serialize_value(std::forward(v)))) + static partition_key from_range(RangeOfSerializedComponents&& v) { + return partition_key(managed_bytes(c_type::serialize_value(std::forward(v)))); + } + + partition_key(std::vector v) + : compound_wrapper(managed_bytes(c_type::serialize_value(std::move(v)))) { } partition_key(partition_key&& v) = default; @@ -705,8 +709,12 @@ class clustering_key_prefix : public prefix_compound_wrapper - clustering_key_prefix(RangeOfSerializedComponents&& v) - : prefix_compound_wrapper(compound::element_type::serialize_value(std::forward(v))) + static clustering_key_prefix from_range(RangeOfSerializedComponents&& v) { + return clustering_key_prefix(compound::element_type::serialize_value(std::forward(v))); + } + + clustering_key_prefix(std::vector v) + : prefix_compound_wrapper(compound::element_type::serialize_value(std::move(v))) { } clustering_key_prefix(clustering_key_prefix&& v) = default; diff --git a/sstables/sstables.cc b/sstables/sstables.cc index e052b929f8..e87515adde 100644 --- a/sstables/sstables.cc +++ b/sstables/sstables.cc @@ -1242,7 +1242,7 @@ void sstable::maybe_flush_pi_block(file_writer& out, // block size of new data. if (!clustering_key.empty()) { auto& rts = _pi_write.tombstone_accumulator->range_tombstones_for_row( - clustering_key_prefix(clustering_key.values())); + clustering_key_prefix::from_range(clustering_key.values())); for (const auto& rt : rts) { auto start = composite::from_clustering_element(*_pi_write.schemap, rt.start); auto end = composite::from_clustering_element(*_pi_write.schemap, rt.end);