–– destroy via table
| 220 | |
| 221 | // –– destroy via table |
| 222 | void destroy_current() FL_NOEXCEPT { |
| 223 | using Fn = void (*)(void *); |
| 224 | FL_DISABLE_WARNING_PUSH |
| 225 | FL_DISABLE_WARNING(array-bounds) |
| 226 | static constexpr Fn table[] = {&variant::template destroy_fn<Types>...}; |
| 227 | if (_tag != Empty) { |
| 228 | table[_tag - 1](&_storage); |
| 229 | } |
| 230 | FL_DISABLE_WARNING_POP |
| 231 | } |
| 232 | |
| 233 | template <typename T> static void destroy_fn(void *storage) FL_NOEXCEPT { |
| 234 | // Use bit_cast_ptr for safe type-punning on properly aligned storage |