try/catch idiom in std.datetime

Jacob Carlborg doob at me.com
Mon Nov 18 13:02:43 PST 2013


On 2013-11-18 20:44, Andrei Alexandrescu wrote:

> I thought about this some more. So std.datetime accounts for > 1/3 of
> all try statements in Phobos. (It also holds a number of other odd
> records - talking from allegations: largest module in source code,
> requires most memory to build for unittest, most unittest lines per line
> of working code. It's great that these are being worked on.) That must
> mean something. The question is what. It may as well mean that the rest
> of Phobos is sloppy and does not add nothrow in places where it should,
> which would make the rest of it insert a bunch of try/catch in the same
> pattern as std.datetime. An argument based on sense and sensibility
> would suggest that something ought to be done about that idiom in
> std.datetime. But the argument "the more nothrow the merrier" is also
> sensible.

I really don't understand the point in having some functions thrown and 
others assert.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list