I would rather make the cast safer using static_cast or dynamic_cast.