On Thursday, 20 February 2014 at 19:46:35 UTC, w0rp wrote:

if (s.length > 0 && s.all!isDigit) {
     // Never throws now.
     auto x = parse!int(s);
}

And what about +/- and U/L suffixes? Or, say, different base (i.e. hexadecimal)?

It would be way more beneficial if Phobos' parse (or some additional function) returned some kind of Optional. Maybe a D implementation of Andrei's Expected<T>?

Reply via email to