24template <
typename T,
typename Deleter = Po
interDeleter<T>>
class scoped_ptr {
27 explicit scoped_ptr(T *ptr =
nullptr, Deleter deleter = Deleter())
65 explicit operator bool() const noexcept {
return ptr_ !=
nullptr; }
100template <
typename T,
typename Deleter = ArrayDeleter<T>>
class scoped_array {
117 other.arr_ =
nullptr;
123 if (
this != &other) {
125 other.arr_ =
nullptr;
137 explicit operator bool() const noexcept {
return arr_ !=
nullptr; }
173template <
typename T,
typename Alloc = fl::allocator<T>>
class scoped_array2 {
183 for (
size_t i = 0; i <
size; ++i) {
193 for (
size_t i = 0; i <
size_; ++i) {
207 other.arr_ =
nullptr;
213 if (
this != &other) {
217 other.arr_ =
nullptr;
233 explicit operator bool() const noexcept {
return arr_ !=
nullptr; }
242 for (
size_t i = 0; i <
size_; ++i) {
256 for (
size_t i = 0; i < new_size; ++i) {
273 size_t tmp_size =
size_;
278 other.arr_ = tmp_arr;
279 other.size_ = tmp_size;
bool operator!() const noexcept
scoped_array2(const scoped_array2 &)=delete
scoped_array2(size_t size=0)
scoped_array2 & operator=(const scoped_array2 &)=delete
FASTLED_DEPRECATED_CLASS("Use fl::vector<T, fl::allocator_psram<T>> instead")
void swap(scoped_array2 &other) noexcept
void reset(size_t new_size=0)
scoped_array2(scoped_array2 &&other) noexcept
scoped_array2 & operator=(scoped_array2 &&other) noexcept
T & operator[](size_t i) const
void reset(T *arr=nullptr)
scoped_array & operator=(const scoped_array &)=delete
scoped_array(scoped_array &&other) noexcept
void swap(scoped_array &other) noexcept
bool operator!() const noexcept
T & operator[](size_t i) const
FASTLED_DEPRECATED_CLASS("Use fl::vector<T, fl::allocator_psram<T>> instead")
scoped_array(const scoped_array &)=delete
scoped_array(T *arr, Deleter deleter)
scoped_array & operator=(scoped_array &&other) noexcept
scoped_array(T *arr=nullptr)
void swap(scoped_ptr &other) noexcept
bool operator!() const noexcept
scoped_ptr(scoped_ptr &&other) noexcept
scoped_ptr(T *ptr=nullptr, Deleter deleter=Deleter())
scoped_ptr & operator=(const scoped_ptr &)=delete
void reset(T *ptr=nullptr)
scoped_ptr(const scoped_ptr &)=delete
Implements the FastLED namespace macros.
Implements a simple red square effect for 2D LED grids.