Skip to content

Commit 7eb62ad

Browse files
committed
Improve: Ban aligned_array copies
1 parent 65bac92 commit 7eb62ad

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

less_slow.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,12 @@ class aligned_array {
358358
if (!data_) throw std::bad_alloc();
359359
}
360360
~aligned_array() noexcept { std::free(data_); }
361+
362+
aligned_array(aligned_array const &) = delete;
363+
aligned_array &operator=(aligned_array const &) = delete;
364+
aligned_array(aligned_array &&) = delete;
365+
aligned_array &operator=(aligned_array &&) = delete;
366+
361367
type_ *begin() const noexcept { return data_; }
362368
type_ *end() const noexcept { return data_ + size_; }
363369
type_ &operator[](std::size_t index) noexcept { return data_[index]; }

0 commit comments

Comments
 (0)