On 05/12/2017 10:32 AM, k-five wrote:
Interesting! I was worried about performance and for that I did not want to use try-catch. So (isNumberic) is a good solution. http://dlang.org/phobos/std_traits.html#isNumeric
If you're doing this for speed, you better be benchmarking. Exceptions are slow when they're thrown. But if no exception is being thrown, try-catch is probably faster than checking isNumeric beforehand.