mirror of
https://github.com/esphome/esphome.git
synced 2025-10-19 02:03:48 +01:00
preen
This commit is contained in:
@@ -208,11 +208,11 @@ template<typename T> class FixedVector {
|
|||||||
|
|
||||||
~FixedVector() { cleanup_(); }
|
~FixedVector() { cleanup_(); }
|
||||||
|
|
||||||
// Disable copy operations - use std::move() to transfer ownership
|
// Disable copy operations (avoid accidental expensive copies)
|
||||||
FixedVector(const FixedVector &) = delete;
|
FixedVector(const FixedVector &) = delete;
|
||||||
FixedVector &operator=(const FixedVector &) = delete;
|
FixedVector &operator=(const FixedVector &) = delete;
|
||||||
|
|
||||||
// Enable move semantics
|
// Enable move semantics (allows use in move-only containers like std::vector)
|
||||||
FixedVector(FixedVector &&other) noexcept : data_(other.data_), size_(other.size_), capacity_(other.capacity_) {
|
FixedVector(FixedVector &&other) noexcept : data_(other.data_), size_(other.size_), capacity_(other.capacity_) {
|
||||||
other.reset_();
|
other.reset_();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user