mirror of
https://github.com/esphome/esphome.git
synced 2026-06-01 01:19:45 +08:00
[helpers] Add conversion from FixedVector to std::vector (#12179)
This commit is contained in:
@@ -242,6 +242,9 @@ template<typename T> class FixedVector {
|
|||||||
other.reset_();
|
other.reset_();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Allow conversion to std::vector
|
||||||
|
operator std::vector<T>() const { return {data_, data_ + size_}; }
|
||||||
|
|
||||||
FixedVector &operator=(FixedVector &&other) noexcept {
|
FixedVector &operator=(FixedVector &&other) noexcept {
|
||||||
if (this != &other) {
|
if (this != &other) {
|
||||||
// Delete our current data
|
// Delete our current data
|
||||||
|
|||||||
Reference in New Issue
Block a user