We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb5de4a commit 20ab2e9Copy full SHA for 20ab2e9
include/cista/containers/vector.h
@@ -78,14 +78,16 @@ struct basic_vector {
78
}
79
80
basic_vector& operator=(basic_vector&& arr) noexcept {
81
- deallocate();
+ if (&arr != this) {
82
+ deallocate();
83
- el_ = arr.el_;
84
- used_size_ = arr.used_size_;
85
- self_allocated_ = arr.self_allocated_;
86
- allocated_size_ = arr.allocated_size_;
+ el_ = arr.el_;
+ used_size_ = arr.used_size_;
+ self_allocated_ = arr.self_allocated_;
87
+ allocated_size_ = arr.allocated_size_;
88
- arr.reset();
89
+ arr.reset();
90
+ }
91
return *this;
92
93
0 commit comments