Converts this value to a T, or throws an error if it cannot be converted.
The type to convert to.
If the value cannot be converted.