diff --git a/tiledb/sm/filter/filter_buffer.cc b/tiledb/sm/filter/filter_buffer.cc index 68373b5322e..0dfeeeb2c15 100644 --- a/tiledb/sm/filter/filter_buffer.cc +++ b/tiledb/sm/filter/filter_buffer.cc @@ -55,11 +55,7 @@ FilterBuffer::BufferOrView::BufferOrView( tdb_new(Buffer, (char*)buffer->data() + offset, nbytes)); } -FilterBuffer::BufferOrView::BufferOrView(BufferOrView&& other) { - underlying_buffer_.swap(other.underlying_buffer_); - view_.swap(other.view_); - std::swap(is_view_, other.is_view_); -} +FilterBuffer::BufferOrView::BufferOrView(BufferOrView&& other) = default; Buffer* FilterBuffer::BufferOrView::buffer() const { return is_view_ ? view_.get() : underlying_buffer_.get(); diff --git a/tiledb/sm/filter/filter_buffer.h b/tiledb/sm/filter/filter_buffer.h index d62d1e3bce7..e44c82f5ee6 100644 --- a/tiledb/sm/filter/filter_buffer.h +++ b/tiledb/sm/filter/filter_buffer.h @@ -339,7 +339,7 @@ class FilterBuffer { shared_ptr underlying_buffer_; /** True if this instance is a view on the underlying buffer. */ - bool is_view_{false}; + bool is_view_; /** * If this instance is a view, the view Buffer (which does not own its diff --git a/tiledb/sm/filter/filter_pipeline.cc b/tiledb/sm/filter/filter_pipeline.cc index 158d9a6fa72..089c14feb37 100644 --- a/tiledb/sm/filter/filter_pipeline.cc +++ b/tiledb/sm/filter/filter_pipeline.cc @@ -68,6 +68,8 @@ FilterPipeline::FilterPipeline( , max_chunk_size_(max_chunk_size) { } +// Unlike move constructors, copy constructors must not use default, +// because individual filters are being copied by calling clone. FilterPipeline::FilterPipeline(const FilterPipeline& other) { for (auto& filter : other.filters_) { add_filter(*filter); @@ -85,9 +87,7 @@ FilterPipeline::FilterPipeline( max_chunk_size_ = other.max_chunk_size_; } -FilterPipeline::FilterPipeline(FilterPipeline&& other) { - swap(other); -} +FilterPipeline::FilterPipeline(FilterPipeline&& other) = default; FilterPipeline& FilterPipeline::operator=(const FilterPipeline& other) { // Call copy constructor @@ -97,10 +97,7 @@ FilterPipeline& FilterPipeline::operator=(const FilterPipeline& other) { return *this; } -FilterPipeline& FilterPipeline::operator=(FilterPipeline&& other) { - swap(other); - return *this; -} +FilterPipeline& FilterPipeline::operator=(FilterPipeline&& other) = default; void FilterPipeline::add_filter(const Filter& filter) { shared_ptr copy(filter.clone()); diff --git a/tiledb/sm/filter/filter_pipeline.h b/tiledb/sm/filter/filter_pipeline.h index f26dff882d3..1db5bcec53b 100644 --- a/tiledb/sm/filter/filter_pipeline.h +++ b/tiledb/sm/filter/filter_pipeline.h @@ -323,7 +323,7 @@ class FilterPipeline { std::vector> filters_; /** The max chunk size allowed within tiles. */ - uint32_t max_chunk_size_{0}; + uint32_t max_chunk_size_; /** * Get the chunk offsets for a var sized tile so that integral cells are