diff --git a/sstables/types.hh b/sstables/types.hh index e2f2eb7bf5..85b81634d7 100644 --- a/sstables/types.hh +++ b/sstables/types.hh @@ -18,6 +18,9 @@ namespace sstables { template struct disk_string { bytes value; + explicit operator bytes_view() const { + return value; + } }; template @@ -51,12 +54,20 @@ struct index_entry { disk_string key; uint64_t position; disk_string promoted_index; + + explicit operator bytes_view() const { + return bytes_view(key); + } }; struct summary_entry { bytes key; uint64_t position; + explicit operator bytes_view() const { + return key; + } + bool operator==(const summary_entry& x) const { return position == x.position && key == x.key; }