|
ESPHome 2026.4.0-dev
|
Lightweight type-erased callback (8 bytes on 32-bit) that avoids std::function overhead. More...
Lightweight type-erased callback (8 bytes on 32-bit) that avoids std::function overhead.
No null check, no exceptions, no heap allocation for small trivially-copyable callables.
With C++20 if constexpr, automatically detects [this] lambdas (sizeof <= sizeof(void*), trivially copyable) and stores them inline. Larger callables are heap-allocated.