safe_cast
