there's absolutely zero compile time safety in your code. If someone copy-pastes for instance
case t_int: printf("An integer: %d\n", s.num); break;
case t_bool: printf("An boolean: %d\n", s.num); break;
it will just break at runtime, unlike std::variant which prevents this at compile time