–– move‐construct via table
| 258 | |
| 259 | // –– move‐construct via table |
| 260 | void move_construct_from(variant &other) FL_NOEXCEPT { |
| 261 | using Fn = void (*)(void *, variant &); |
| 262 | FL_DISABLE_WARNING_PUSH |
| 263 | FL_DISABLE_WARNING(array-bounds) |
| 264 | static constexpr Fn table[] = {&variant::template move_fn<Types>...}; |
| 265 | table[other._tag - 1](&_storage, other); |
| 266 | FL_DISABLE_WARNING_POP |
| 267 | _tag = other._tag; |
| 268 | other.reset(); |
| 269 | } |
| 270 | |
| 271 | template <typename T> static void move_fn(void *storage, variant &other) FL_NOEXCEPT { |
| 272 | // Use bit_cast_ptr for safe type-punning on properly aligned storage |