mirror of
https://github.com/esphome/esphome.git
synced 2025-11-01 23:51:47 +00:00
compat
This commit is contained in:
@@ -215,6 +215,7 @@ template<typename T> class FixedVector {
|
|||||||
~FixedVector() { cleanup_(); }
|
~FixedVector() { cleanup_(); }
|
||||||
|
|
||||||
// Disable copy operations (avoid accidental expensive copies)
|
// Disable copy operations (avoid accidental expensive copies)
|
||||||
|
// Use copy_from() for explicit copying when needed (e.g., copy_select)
|
||||||
FixedVector(const FixedVector &) = delete;
|
FixedVector(const FixedVector &) = delete;
|
||||||
FixedVector &operator=(const FixedVector &) = delete;
|
FixedVector &operator=(const FixedVector &) = delete;
|
||||||
|
|
||||||
@@ -246,8 +247,10 @@ template<typename T> class FixedVector {
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Copy another FixedVector (explicit copy for special cases like copy_select)
|
/// Explicitly copy another FixedVector
|
||||||
/// Creates exact duplicate of source vector
|
/// This method exists instead of operator= to make copying intentional and visible.
|
||||||
|
/// Copying is expensive on embedded systems, so we require explicit opt-in.
|
||||||
|
/// Use cases: copy_select (copying source options), lvgl (copying widget options)
|
||||||
void copy_from(const FixedVector &other) {
|
void copy_from(const FixedVector &other) {
|
||||||
cleanup_();
|
cleanup_();
|
||||||
reset_();
|
reset_();
|
||||||
|
|||||||
Reference in New Issue
Block a user